| author | |
| committer | |
| log | 2722fd1f247a5db7f6371dbaa778fa0d59510b9b |
| tree | dd1fd76f12b9ce48323b4612e94bb1b6d96ad199 |
| parent | 674b25fad692565bf10d69fab669be52171d5bf3 |
3 files changed, 13 insertions(+), 6 deletions(-)
src/cmd/fetch.zig+1-4| ... | ... | @@ -138,10 +138,7 @@ fn create_lockfile(alloc: std.mem.Allocator, list: *std.ArrayList(zigmod.Module) |
| 138 | 138 | try wl.writeAll("2\n"); |
| 139 | 139 | for (list.items) |m| { |
| 140 | 140 | if (m.dep) |md| { |
| 141 | if (md.type == .local) { | |
| 142 | continue; | |
| 143 | } | |
| 144 | if (md.type == .system_lib) continue; | |
| 141 | if (md.type.isLocal()) continue; | |
| 145 | 142 | const mpath = try std.fs.path.join(alloc, &.{ path, m.clean_path }); |
| 146 | 143 | const version = try md.exact_version(mpath); |
| 147 | 144 | try wl.print("{s} {s} {s}\n", .{ @tagName(md.type), md.path, version }); |
src/common.zig+2-2| ... | ... | @@ -108,7 +108,7 @@ pub fn get_modpath(cachepath: string, d: zigmod.Dep, options: *CollectOptions) ! |
| 108 | 108 | const p = try std.fs.path.join(options.alloc, &.{ cachepath, try d.clean_path() }); |
| 109 | 109 | const pv = try std.fs.path.join(options.alloc, &.{ cachepath, try d.clean_path_v() }); |
| 110 | 110 | |
| 111 | const nocache = d.type == .local or d.type == .system_lib; | |
| 111 | const nocache = d.type.isLocal(); | |
| 112 | 112 | if (!nocache and u.list_contains(options.already_fetched.items, p)) return p; |
| 113 | 113 | if (!nocache and u.list_contains(options.already_fetched.items, pv)) return pv; |
| 114 | 114 | |
| ... | ... | @@ -223,7 +223,7 @@ pub fn get_module_from_dep(d: *zigmod.Dep, cachepath: string, options: *CollectO |
| 223 | 223 | const modpath = try get_modpath(cachepath, d.*, options); |
| 224 | 224 | const moddir = if (std.mem.eql(u8, modpath, "files") or modpath.len == 0) try std.fs.cwd().openDir(cachepath, .{}) else try std.fs.cwd().openDir(modpath, .{}); |
| 225 | 225 | |
| 226 | const nocache = d.type == .local or d.type == .system_lib; | |
| 226 | const nocache = d.type.isLocal(); | |
| 227 | 227 | if (!nocache) try options.already_fetched.append(modpath); |
| 228 | 228 | |
| 229 | 229 | switch (d.type) { |
src/util/dep_type.zig+10| ... | ... | @@ -89,6 +89,16 @@ pub const DepType = enum { |
| 89 | 89 | }; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | pub fn isLocal(self: DepType) bool { | |
| 93 | return switch (self) { | |
| 94 | .local => true, | |
| 95 | .system_lib => true, | |
| 96 | .git => false, | |
| 97 | .hg => false, | |
| 98 | .http => false, | |
| 99 | }; | |
| 100 | } | |
| 101 | ||
| 92 | 102 | pub const GitVersion = enum { |
| 93 | 103 | branch, |
| 94 | 104 | tag, |