mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-26 13:01:34 +03:00
Fetch: Fix zip fetching when cache directory doesn't have tmp dir
Fixes #31964
This commit is contained in:
committed by
Alex Rønne Petersen
parent
92517c04c7
commit
7056ba9a5c
+14
-2
@@ -1513,7 +1513,19 @@ fn unzip(
|
|||||||
.read = true,
|
.read = true,
|
||||||
}) catch |err| switch (err) {
|
}) catch |err| switch (err) {
|
||||||
error.PathAlreadyExists => continue,
|
error.PathAlreadyExists => continue,
|
||||||
error.Canceled => return error.Canceled,
|
error.FileNotFound => {
|
||||||
|
cache_root.handle.createDir(io, prefix, .default_dir) catch |dir_err| switch (dir_err) {
|
||||||
|
error.Canceled => |e| return e,
|
||||||
|
// error.PathAlreadyExists is considered a failure here because
|
||||||
|
// it implies that the prefix is not a directory.
|
||||||
|
else => |e| return f.fail(
|
||||||
|
f.location_tok,
|
||||||
|
try eb.printString("failed to create temporary directory: {t}", .{e}),
|
||||||
|
),
|
||||||
|
};
|
||||||
|
continue;
|
||||||
|
},
|
||||||
|
error.Canceled => |e| return e,
|
||||||
else => |e| return f.fail(
|
else => |e| return f.fail(
|
||||||
f.location_tok,
|
f.location_tok,
|
||||||
try eb.printString("failed to create temporary zip file: {t}", .{e}),
|
try eb.printString("failed to create temporary zip file: {t}", .{e}),
|
||||||
@@ -1526,7 +1538,7 @@ fn unzip(
|
|||||||
var zip_file_writer = zip_file.writer(io, &zip_file_buffer);
|
var zip_file_writer = zip_file.writer(io, &zip_file_buffer);
|
||||||
|
|
||||||
_ = reader.streamRemaining(&zip_file_writer.interface) catch |err| switch (err) {
|
_ = reader.streamRemaining(&zip_file_writer.interface) catch |err| switch (err) {
|
||||||
error.ReadFailed => return error.ReadFailed,
|
error.ReadFailed => |e| return e,
|
||||||
error.WriteFailed => return f.fail(
|
error.WriteFailed => return f.fail(
|
||||||
f.location_tok,
|
f.location_tok,
|
||||||
try eb.printString("failed writing temporary zip file: {t}", .{err}),
|
try eb.printString("failed writing temporary zip file: {t}", .{err}),
|
||||||
|
|||||||
Reference in New Issue
Block a user