chore: port build script to zig stage2
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c4878e6d42
commit
b5883bccd8
13
build.zig
13
build.zig
|
@ -78,7 +78,7 @@ pub fn main() !void {
|
||||||
zip.?,
|
zip.?,
|
||||||
entry.?,
|
entry.?,
|
||||||
&buf,
|
&buf,
|
||||||
path,
|
path.ptr,
|
||||||
file,
|
file,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -138,9 +138,8 @@ fn archiveFile(
|
||||||
try handleArchiveErr(c.archive_write_header(archive, entry), archive);
|
try handleArchiveErr(c.archive_write_header(archive, entry), archive);
|
||||||
|
|
||||||
const writer = ArchiveWriter{ .context = archive };
|
const writer = ArchiveWriter{ .context = archive };
|
||||||
try std.fifo.LinearFifo(u8, .Slice)
|
var fifo = std.fifo.LinearFifo(u8, .Slice).init(buf);
|
||||||
.init(buf)
|
try fifo.pump(file.reader(), writer);
|
||||||
.pump(file.reader(), writer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `name` must end with '/'!
|
/// `name` must end with '/'!
|
||||||
|
@ -313,12 +312,12 @@ fn downloadMods(
|
||||||
try handleCurlErr(c.curl_easy_setopt(
|
try handleCurlErr(c.curl_easy_setopt(
|
||||||
curl,
|
curl,
|
||||||
c.CURLOPT_WRITEFUNCTION,
|
c.CURLOPT_WRITEFUNCTION,
|
||||||
curlWriteCallback,
|
&curlWriteCallback,
|
||||||
));
|
));
|
||||||
try handleCurlErr(c.curl_easy_setopt(
|
try handleCurlErr(c.curl_easy_setopt(
|
||||||
curl,
|
curl,
|
||||||
c.CURLOPT_XFERINFOFUNCTION,
|
c.CURLOPT_XFERINFOFUNCTION,
|
||||||
curlInfoCallback,
|
&curlInfoCallback,
|
||||||
));
|
));
|
||||||
try handleCurlErr(c.curl_easy_setopt(curl, c.CURLOPT_NOPROGRESS, @as(c_long, 0)));
|
try handleCurlErr(c.curl_easy_setopt(curl, c.CURLOPT_NOPROGRESS, @as(c_long, 0)));
|
||||||
try handleCurlErr(c.curl_easy_setopt(curl, c.CURLOPT_FOLLOWLOCATION, @as(c_long, 1)));
|
try handleCurlErr(c.curl_easy_setopt(curl, c.CURLOPT_FOLLOWLOCATION, @as(c_long, 1)));
|
||||||
|
@ -380,7 +379,7 @@ fn downloadMods(
|
||||||
try handleCurlErr(c.curl_easy_setopt(
|
try handleCurlErr(c.curl_easy_setopt(
|
||||||
curl,
|
curl,
|
||||||
c.CURLOPT_URL,
|
c.CURLOPT_URL,
|
||||||
@ptrCast([*c]const u8, mod_cstr),
|
mod_cstr.ptr,
|
||||||
));
|
));
|
||||||
try handleCurlErr(c.curl_easy_perform(curl));
|
try handleCurlErr(c.curl_easy_perform(curl));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue