Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b0160e005b |
@@ -17,15 +17,15 @@ jobs:
|
|||||||
- name: Build normal version
|
- name: Build normal version
|
||||||
run: zig build -Drelease=true -Dversion=${{ github.ref_name }}
|
run: zig build -Drelease=true -Dversion=${{ github.ref_name }}
|
||||||
- name: Move normal build out
|
- name: Move normal build out
|
||||||
run: mv zig-out/bin/unsquashfs ./
|
run: mv zig-out/bin/unsquashfs ./unsquashfs-x86_64
|
||||||
- name: Rebuild with C libraries
|
- name: Rebuild with C libraries
|
||||||
run: zig build -Drelease=true -Duse_c_libs=true -Dversion="${{ github.ref_name }}"
|
run: zig build --release=fast -Drelease=true -Duse_c_libs=true -Dversion="${{ github.ref_name }}"
|
||||||
- name: Move C build out
|
- name: Move C build out
|
||||||
run: mv zig-out/bin/unsquashfs ./unsquashfs-c-libs
|
run: mv zig-out/bin/unsquashfs ./unsquashfs-x86_64-c-libs
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
prerelease: true
|
prerelease: true
|
||||||
files: |
|
files: |
|
||||||
unsquashfs
|
unsquashfs-x86_64
|
||||||
unsquashfs-c-libs
|
unsquashfs-x86_64-c-libs
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
zig_squashfs_options.addOption(bool, "allow_lzo", allow_lzo orelse false);
|
zig_squashfs_options.addOption(bool, "allow_lzo", allow_lzo orelse false);
|
||||||
|
|
||||||
const target = b.standardTargetOptions(.{});
|
const target = b.standardTargetOptions(.{});
|
||||||
const optimize = b.standardOptimizeOption(.{ .preferred_optimize_mode = .ReleaseFast });
|
const optimize = b.standardOptimizeOption(.{});
|
||||||
const mod = b.addModule("zig_squashfs", .{
|
const mod = b.addModule("zig_squashfs", .{
|
||||||
.root_source_file = b.path("src/root.zig"),
|
.root_source_file = b.path("src/root.zig"),
|
||||||
.target = target,
|
.target = target,
|
||||||
|
|||||||
+3
-4
@@ -199,7 +199,7 @@ const Parent = struct {
|
|||||||
ignore_permissions: bool,
|
ignore_permissions: bool,
|
||||||
ignore_xattr: bool,
|
ignore_xattr: bool,
|
||||||
|
|
||||||
wg: WaitGroup,
|
wg: WaitGroup = .{},
|
||||||
mut: Mutex = .{},
|
mut: Mutex = .{},
|
||||||
|
|
||||||
fn create(alloc: std.mem.Allocator, hdr: Header, archive: *Archive, path: []const u8, options: ExtractionOptions, dir_size: usize) !*Parent {
|
fn create(alloc: std.mem.Allocator, hdr: Header, archive: *Archive, path: []const u8, options: ExtractionOptions, dir_size: usize) !*Parent {
|
||||||
@@ -216,9 +216,8 @@ const Parent = struct {
|
|||||||
|
|
||||||
.ignore_permissions = options.ignore_permissions,
|
.ignore_permissions = options.ignore_permissions,
|
||||||
.ignore_xattr = options.ignore_xattr,
|
.ignore_xattr = options.ignore_xattr,
|
||||||
|
|
||||||
.wg = .{ .state = .init(dir_size) },
|
|
||||||
};
|
};
|
||||||
|
out.wg.startMany(dir_size);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,7 +231,7 @@ const Parent = struct {
|
|||||||
defer p.alloc.destroy(p);
|
defer p.alloc.destroy(p);
|
||||||
var fil = try std.fs.cwd().openFile(p.path, .{});
|
var fil = try std.fs.cwd().openFile(p.path, .{});
|
||||||
defer fil.close();
|
defer fil.close();
|
||||||
const time = p.mod_time * 1000000000;
|
const time = @as(i128, p.mod_time) * 1000000000;
|
||||||
try fil.updateTimes(time, time);
|
try fil.updateTimes(time, time);
|
||||||
if (p.ignore_permissions) {
|
if (p.ignore_permissions) {
|
||||||
try fil.chmod(p.perm);
|
try fil.chmod(p.perm);
|
||||||
|
|||||||
Reference in New Issue
Block a user