| author | |
| committer | |
| log | f12542b93daa5ece650a79b08766594dd25692a0 |
| tree | e6b40c1460d2c81a1d992eaab5fb499bd40b3d36 |
| parent | f842053622e10883b17aec241587cd962c35971b |
4 files changed, 7 insertions(+), 17 deletions(-)
src/cmd/fetch.zig+4-4| ... | ... | @@ -116,7 +116,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D |
| 116 | 116 | try w.writeAll("pub const package_data = struct {\n"); |
| 117 | 117 | var duped = std.ArrayList(zigmod.Module).init(alloc); |
| 118 | 118 | for (list.items) |mod| { |
| 119 | if (mod.is_sys_lib or mod.is_framework) { | |
| 119 | if (mod.type == .system_lib or mod.type == .framework) { | |
| 120 | 120 | continue; |
| 121 | 121 | } |
| 122 | 122 | try duped.append(mod); |
| ... | ... | @@ -249,7 +249,7 @@ fn diff_printchange(comptime testt: string, comptime replacement: string, item: |
| 249 | 249 | |
| 250 | 250 | fn print_dirs(w: std.fs.File.Writer, list: []const zigmod.Module) !void { |
| 251 | 251 | for (list) |mod| { |
| 252 | if (mod.is_sys_lib or mod.is_framework) continue; | |
| 252 | if (mod.type == .system_lib or mod.type == .framework) continue; | |
| 253 | 253 | if (std.mem.eql(u8, mod.id, "root")) { |
| 254 | 254 | try w.writeAll(" pub const _root = \"\";\n"); |
| 255 | 255 | continue; |
| ... | ... | @@ -332,7 +332,7 @@ fn print_pkg_data_to(w: std.fs.File.Writer, notdone: *std.ArrayList(zigmod.Modul |
| 332 | 332 | if (mod.has_syslib_deps()) { |
| 333 | 333 | try w.writeAll(" .system_libs = &.{"); |
| 334 | 334 | for (mod.deps) |item, j| { |
| 335 | if (!item.is_sys_lib) continue; | |
| 335 | if (!(item.type == .system_lib)) continue; | |
| 336 | 336 | try w.print(" \"{}\"", .{std.zig.fmtEscapes(item.name)}); |
| 337 | 337 | if (j != mod.deps.len - 1) try w.writeAll(","); |
| 338 | 338 | } |
| ... | ... | @@ -341,7 +341,7 @@ fn print_pkg_data_to(w: std.fs.File.Writer, notdone: *std.ArrayList(zigmod.Modul |
| 341 | 341 | if (mod.has_framework_deps()) { |
| 342 | 342 | try w.writeAll(" .frameworks = &.{"); |
| 343 | 343 | for (mod.deps) |item, j| { |
| 344 | if (!item.is_sys_lib) continue; | |
| 344 | if (!(item.type == .system_lib)) continue; | |
| 345 | 345 | try w.print(" \"{}\"", .{std.zig.fmtEscapes(item.name)}); |
| 346 | 346 | if (j != mod.deps.len - 1) try w.writeAll(","); |
| 347 | 347 | } |
src/cmd/sum.zig+1-1| ... | ... | @@ -36,7 +36,7 @@ pub fn execute(args: [][]u8) !void { |
| 36 | 36 | if (std.mem.eql(u8, m.clean_path, "../..")) { |
| 37 | 37 | continue; |
| 38 | 38 | } |
| 39 | if (m.is_sys_lib or m.is_framework) continue; | |
| 39 | if (m.type.isLocal()) continue; | |
| 40 | 40 | const hash = try m.get_hash(gpa, cachepath); |
| 41 | 41 | try w.print("{s} {s}\n", .{ hash, m.clean_path }); |
| 42 | 42 | } |
src/common.zig-6| ... | ... | @@ -48,8 +48,6 @@ pub fn collect_deps_deep(cachepath: string, mdir: std.fs.Dir, options: *CollectO |
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | return zigmod.Module{ |
| 51 | .is_sys_lib = false, | |
| 52 | .is_framework = false, | |
| 53 | 51 | .type = .local, |
| 54 | 52 | .id = "root", |
| 55 | 53 | .name = "root", |
| ... | ... | @@ -78,8 +76,6 @@ pub fn collect_deps(cachepath: string, mdir: std.fs.Dir, options: *CollectOption |
| 78 | 76 | } |
| 79 | 77 | } |
| 80 | 78 | return zigmod.Module{ |
| 81 | .is_sys_lib = false, | |
| 82 | .is_framework = false, | |
| 83 | 79 | .type = .local, |
| 84 | 80 | .id = m.id, |
| 85 | 81 | .name = m.name, |
| ... | ... | @@ -231,8 +227,6 @@ pub fn get_module_from_dep(d: *zigmod.Dep, cachepath: string, options: *CollectO |
| 231 | 227 | switch (d.type) { |
| 232 | 228 | .system_lib, .framework => { |
| 233 | 229 | return zigmod.Module{ |
| 234 | .is_sys_lib = d.type == .system_lib, | |
| 235 | .is_framework = d.type == .framework, | |
| 236 | 230 | .type = d.type, |
| 237 | 231 | .id = try u.do_hash(options.alloc, std.crypto.hash.sha3.Sha3_384, d.path), |
| 238 | 232 | .name = d.path, |
src/util/module.zig+2-6| ... | ... | @@ -11,8 +11,6 @@ const common = @import("./../common.zig"); |
| 11 | 11 | // |
| 12 | 12 | |
| 13 | 13 | pub const Module = struct { |
| 14 | is_sys_lib: bool, | |
| 15 | is_framework: bool, | |
| 16 | 14 | type: zigmod.Dep.Type, |
| 17 | 15 | id: string, |
| 18 | 16 | name: string, |
| ... | ... | @@ -40,8 +38,6 @@ pub const Module = struct { |
| 40 | 38 | } |
| 41 | 39 | } |
| 42 | 40 | return Module{ |
| 43 | .is_sys_lib = false, | |
| 44 | .is_framework = false, | |
| 45 | 41 | .type = dep.type, |
| 46 | 42 | .id = if (dep.id.len > 0) dep.id else try u.random_string(alloc, 48), |
| 47 | 43 | .name = dep.name, |
| ... | ... | @@ -120,7 +116,7 @@ pub const Module = struct { |
| 120 | 116 | |
| 121 | 117 | pub fn has_syslib_deps(self: Module) bool { |
| 122 | 118 | for (self.deps) |d| { |
| 123 | if (d.is_sys_lib) { | |
| 119 | if (d.type == .system_lib) { | |
| 124 | 120 | return true; |
| 125 | 121 | } |
| 126 | 122 | } |
| ... | ... | @@ -129,7 +125,7 @@ pub const Module = struct { |
| 129 | 125 | |
| 130 | 126 | pub fn has_framework_deps(self: Module) bool { |
| 131 | 127 | for (self.deps) |d| { |
| 132 | if (d.is_framework) { | |
| 128 | if (d.type == .framework) { | |
| 133 | 129 | return true; |
| 134 | 130 | } |
| 135 | 131 | } |