diff options
Diffstat (limited to 'src/install.zig')
| -rw-r--r-- | src/install.zig | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/install.zig b/src/install.zig index f9c7309..27db4bb 100644 --- a/src/install.zig +++ b/src/install.zig | |||
| @@ -20,7 +20,7 @@ pub const max_args = 1; | |||
| 20 | 20 | ||
| 21 | pub fn main(comptime Result: type, config: Config, res: Result) !void { | 21 | pub fn main(comptime Result: type, config: Config, res: Result) !void { |
| 22 | const allocator = config.allocator; | 22 | const allocator = config.allocator; |
| 23 | 23 | ||
| 24 | var available = try Installation.getAvailableList(config); | 24 | var available = try Installation.getAvailableList(config); |
| 25 | defer Installation.deinitMap(allocator, &available); | 25 | defer Installation.deinitMap(allocator, &available); |
| 26 | 26 | ||
| @@ -80,13 +80,15 @@ pub fn perform(allocator: Allocator, name: []const u8, force: bool, available: I | |||
| 80 | try archive.supportFormat(.all); | 80 | try archive.supportFormat(.all); |
| 81 | try archive.openFilename(tmpname, 10240); | 81 | try archive.openFilename(tmpname, 10240); |
| 82 | 82 | ||
| 83 | while (try archive.nextHeader()) |*entry| { | 83 | while (try archive.nextHeader()) |entry_c| { |
| 84 | var entry = entry_c; | ||
| 85 | |||
| 84 | const source = entry.pathname(); | 86 | const source = entry.pathname(); |
| 85 | const dest = try preparePathname(allocator, installation_dir, source); | 87 | const dest = try preparePathname(allocator, installation_dir, source); |
| 86 | defer allocator.free(dest); | 88 | defer allocator.free(dest); |
| 87 | 89 | ||
| 88 | entry.setPathname(dest); | 90 | entry.setPathname(dest); |
| 89 | try archive.extract(entry.*, 0); | 91 | try archive.extract(entry, 0); |
| 90 | } | 92 | } |
| 91 | 93 | ||
| 92 | std.log.info("Installed to {s}", .{installation_dir}); | 94 | std.log.info("Installed to {s}", .{installation_dir}); |