From 39764f0ec557b095e337a13581408ba5651a77e8 Mon Sep 17 00:00:00 2001 From: Ed Yu Date: Fri, 15 Dec 2023 14:22:44 -0800 Subject: [PATCH] Update pkghash to use the new fs.dir changes --- tools/pkghash.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/pkghash.zig b/tools/pkghash.zig index 61d4009..805206a 100644 --- a/tools/pkghash.zig +++ b/tools/pkghash.zig @@ -266,8 +266,8 @@ pub fn cmdPkg(gpa: Allocator, arena: Allocator, args: []const []const u8) !void // computePackageHash will close the directory after completion // std.debug.print("abspath: {s}\n", .{cwd_absolute_path}); - var cwd_copy = try fs.openIterableDirAbsolute(cwd_absolute_path, .{}); - errdefer cwd_copy.dir.close(); + var cwd_copy = try fs.openDirAbsolute(cwd_absolute_path, .{}); + errdefer cwd_copy.close(); var thread_pool: ThreadPool = undefined; try thread_pool.init(.{ .allocator = gpa }); @@ -281,7 +281,7 @@ pub fn cmdPkg(gpa: Allocator, arena: Allocator, args: []const []const u8) !void }; break :blk try computePackageHashExcludingDirectories( &thread_pool, - .{ .dir = cwd_copy.dir }, + cwd_copy, excluded_directories, ); }; @@ -355,7 +355,7 @@ fn isExecutable(file: fs.File) !bool { pub fn computePackageHashExcludingDirectories( thread_pool: *ThreadPool, - pkg_dir: fs.IterableDir, + pkg_dir: fs.Dir, excluded_directories: []const []const u8, ) ![Manifest.Hash.digest_length]u8 { const gpa = thread_pool.allocator; @@ -405,7 +405,7 @@ pub fn computePackageHashExcludingDirectories( .failure = undefined, // to be populated by the worker }; wait_group.start(); - try thread_pool.spawn(workerHashFile, .{ pkg_dir.dir, hashed_file, &wait_group }); + try thread_pool.spawn(workerHashFile, .{ pkg_dir, hashed_file, &wait_group }); try all_files.append(hashed_file); }