| ... | @@ -109,13 +109,14 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D | ... | @@ -109,13 +109,14 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D |
| 109 | | 109 | |
| 110 | try w.writeAll("pub const package_data = struct {\n"); | 110 | try w.writeAll("pub const package_data = struct {\n"); |
| 111 | var duped = std.ArrayList(zigmod.Module).init(alloc); | 111 | var duped = std.ArrayList(zigmod.Module).init(alloc); |
| | 112 | var done = std.ArrayList(zigmod.Module).init(alloc); |
| 112 | for (list.items) |mod| { | 113 | for (list.items) |mod| { |
| 113 | if (mod.type == .system_lib or mod.type == .framework) { | 114 | if (mod.type == .system_lib or mod.type == .framework) { |
| 114 | continue; | 115 | continue; |
| 115 | } | 116 | } |
| 116 | try duped.append(mod); | 117 | try duped.append(mod); |
| 117 | } | 118 | } |
| 118 | try print_pkg_data_to(w, &duped, &std.ArrayList(zigmod.Module).init(alloc)); | 119 | try print_pkg_data_to(w, &duped, &done); |
| 119 | try w.writeAll("};\n\n"); | 120 | try w.writeAll("};\n\n"); |
| 120 | | 121 | |
| 121 | try w.writeAll("pub const packages = "); | 122 | try w.writeAll("pub const packages = "); |
| ... | @@ -159,7 +160,8 @@ fn diff_lockfile(alloc: std.mem.Allocator) !void { | ... | @@ -159,7 +160,8 @@ fn diff_lockfile(alloc: std.mem.Allocator) !void { |
| 159 | | 160 | |
| 160 | if (try u.does_folder_exist(".git")) { | 161 | if (try u.does_folder_exist(".git")) { |
| 161 | const result = try u.run_cmd_raw(alloc, null, &.{ "git", "diff", "zigmod.lock" }); | 162 | const result = try u.run_cmd_raw(alloc, null, &.{ "git", "diff", "zigmod.lock" }); |
| 162 | const r = std.io.fixedBufferStream(result.stdout).reader(); | 163 | var stdout = std.io.fixedBufferStream(result.stdout); |
| | 164 | const r = stdout.reader(); |
| 163 | while (try r.readUntilDelimiterOrEofAlloc(alloc, '\n', max)) |line| { | 165 | while (try r.readUntilDelimiterOrEofAlloc(alloc, '\n', max)) |line| { |
| 164 | if (std.mem.startsWith(u8, line, "@@")) break; | 166 | if (std.mem.startsWith(u8, line, "@@")) break; |
| 165 | } | 167 | } |