| author | |
| committer | |
| log | f086ea856cd478eae5ace81c6a653f2b5b976352 |
| tree | 82efbd92457942d4eb6d536857230d1aaa6a2019 |
| parent | 30a319be6dd14c773094e784c27b89b4f10622b2 |
Or other platform which don't support symlinks.2 files changed, 7 insertions(+), 3 deletions(-)
lib/std/tar.zig+1-1| ... | ... | @@ -564,7 +564,7 @@ pub fn pipeToFileSystem(dir: std.fs.Dir, reader: anytype, options: Options) !voi |
| 564 | 564 | const link_name = file.link_name; |
| 565 | 565 | |
| 566 | 566 | createDirAndSymlink(dir, link_name, file_name) catch |err| { |
| 567 | const d = options.diagnostics orelse return err; | |
| 567 | const d = options.diagnostics orelse return error.UnableToCreateSymLink; | |
| 568 | 568 | try d.errors.append(d.allocator, .{ .unable_to_create_sym_link = .{ |
| 569 | 569 | .code = err, |
| 570 | 570 | .file_name = try d.allocator.dupe(u8, file_name), |
lib/std/tar/test.zig+6-2| ... | ... | @@ -467,11 +467,15 @@ test "tar pipeToFileSystem" { |
| 467 | 467 | var root = std.testing.tmpDir(.{ .no_follow = true }); |
| 468 | 468 | defer root.cleanup(); |
| 469 | 469 | |
| 470 | try tar.pipeToFileSystem(root.dir, fsb.reader(), .{ | |
| 470 | tar.pipeToFileSystem(root.dir, fsb.reader(), .{ | |
| 471 | 471 | .mode_mode = .ignore, |
| 472 | 472 | .strip_components = 1, |
| 473 | 473 | .exclude_empty_directories = true, |
| 474 | }); | |
| 474 | }) catch |err| { | |
| 475 | // Skip on platform which don't support symlinks | |
| 476 | if (err == error.UnableToCreateSymLink) return error.SkipZigTest; | |
| 477 | return err; | |
| 478 | }; | |
| 475 | 479 | |
| 476 | 480 | try testing.expectError(error.FileNotFound, root.dir.statFile("empty")); |
| 477 | 481 | try testing.expect((try root.dir.statFile("a/file")).kind == .file); |