| ... | @@ -1861,6 +1861,8 @@ const UnpackResult = struct { | ... | @@ -1861,6 +1861,8 @@ const UnpackResult = struct { |
| 1861 | if (self.errors.items.len == 0 and self.root_error_message.len == 0) | 1861 | if (self.errors.items.len == 0 and self.root_error_message.len == 0) |
| 1862 | return; | 1862 | return; |
| 1863 | | 1863 | |
| | 1864 | const root_dir = if (self.root_dir) |root_dir| root_dir else ""; |
| | 1865 | |
| 1864 | const notes_len: u32 = @intCast(self.errors.items.len); | 1866 | const notes_len: u32 = @intCast(self.errors.items.len); |
| 1865 | try eb.addRootErrorMessage(.{ | 1867 | try eb.addRootErrorMessage(.{ |
| 1866 | .msg = try eb.addString(self.root_error_message), | 1868 | .msg = try eb.addString(self.root_error_message), |
| ... | @@ -1873,21 +1875,21 @@ const UnpackResult = struct { | ... | @@ -1873,21 +1875,21 @@ const UnpackResult = struct { |
| 1873 | .unable_to_create_sym_link => |info| { | 1875 | .unable_to_create_sym_link => |info| { |
| 1874 | eb.extra.items[note_i] = @intFromEnum(try eb.addErrorMessage(.{ | 1876 | eb.extra.items[note_i] = @intFromEnum(try eb.addErrorMessage(.{ |
| 1875 | .msg = try eb.printString("unable to create symlink from '{s}' to '{s}': {s}", .{ | 1877 | .msg = try eb.printString("unable to create symlink from '{s}' to '{s}': {s}", .{ |
| 1876 | info.file_name, info.link_name, @errorName(info.code), | 1878 | stripRoot(info.file_name, root_dir), info.link_name, @errorName(info.code), |
| 1877 | }), | 1879 | }), |
| 1878 | })); | 1880 | })); |
| 1879 | }, | 1881 | }, |
| 1880 | .unable_to_create_file => |info| { | 1882 | .unable_to_create_file => |info| { |
| 1881 | eb.extra.items[note_i] = @intFromEnum(try eb.addErrorMessage(.{ | 1883 | eb.extra.items[note_i] = @intFromEnum(try eb.addErrorMessage(.{ |
| 1882 | .msg = try eb.printString("unable to create file '{s}': {s}", .{ | 1884 | .msg = try eb.printString("unable to create file '{s}': {s}", .{ |
| 1883 | info.file_name, @errorName(info.code), | 1885 | stripRoot(info.file_name, root_dir), @errorName(info.code), |
| 1884 | }), | 1886 | }), |
| 1885 | })); | 1887 | })); |
| 1886 | }, | 1888 | }, |
| 1887 | .unsupported_file_type => |info| { | 1889 | .unsupported_file_type => |info| { |
| 1888 | eb.extra.items[note_i] = @intFromEnum(try eb.addErrorMessage(.{ | 1890 | eb.extra.items[note_i] = @intFromEnum(try eb.addErrorMessage(.{ |
| 1889 | .msg = try eb.printString("file '{s}' has unsupported type '{c}'", .{ | 1891 | .msg = try eb.printString("file '{s}' has unsupported type '{c}'", .{ |
| 1890 | info.file_name, info.file_type, | 1892 | stripRoot(info.file_name, root_dir), info.file_type, |
| 1891 | }), | 1893 | }), |
| 1892 | })); | 1894 | })); |
| 1893 | }, | 1895 | }, |
| ... | @@ -1914,8 +1916,8 @@ test "tarball with duplicate file names" { | ... | @@ -1914,8 +1916,8 @@ test "tarball with duplicate file names" { |
| 1914 | | 1916 | |
| 1915 | try fb.expectFetchErrors(2, | 1917 | try fb.expectFetchErrors(2, |
| 1916 | \\error: unable to unpack tarball | 1918 | \\error: unable to unpack tarball |
| 1917 | \\ note: unable to create file 'package.tar/dir/file': PathAlreadyExists | 1919 | \\ note: unable to create file 'dir/file': PathAlreadyExists |
| 1918 | \\ note: unable to create file 'package.tar/dir1/file1': PathAlreadyExists | 1920 | \\ note: unable to create file 'dir1/file1': PathAlreadyExists |
| 1919 | \\ | 1921 | \\ |
| 1920 | ); | 1922 | ); |
| 1921 | } | 1923 | } |