| ... | @@ -1181,7 +1181,13 @@ fn recursiveDirectoryCopy(f: *Fetch, dir: fs.IterableDir, tmp_dir: fs.Dir) anyer | ... | @@ -1181,7 +1181,13 @@ fn recursiveDirectoryCopy(f: *Fetch, dir: fs.IterableDir, tmp_dir: fs.Dir) anyer |
| 1181 | const link_name = try dir.dir.readLink(entry.path, &buf); | 1181 | const link_name = try dir.dir.readLink(entry.path, &buf); |
| 1182 | // TODO: if this would create a symlink to outside | 1182 | // TODO: if this would create a symlink to outside |
| 1183 | // the destination directory, fail with an error instead. | 1183 | // the destination directory, fail with an error instead. |
| 1184 | try tmp_dir.symLink(link_name, entry.path, .{}); | 1184 | tmp_dir.symLink(link_name, entry.path, .{}) catch |err| switch (err) { |
| | 1185 | error.FileNotFound => { |
| | 1186 | if (fs.path.dirname(entry.path)) |dirname| try tmp_dir.makePath(dirname); |
| | 1187 | try tmp_dir.symLink(link_name, entry.path, .{}); |
| | 1188 | }, |
| | 1189 | else => |e| return e, |
| | 1190 | }; |
| 1185 | }, | 1191 | }, |
| 1186 | else => return error.IllegalFileTypeInPackage, | 1192 | else => return error.IllegalFileTypeInPackage, |
| 1187 | } | 1193 | } |