| author | |
| committer | |
| log | 6fd42714e7ec2ab81732770c6eebc9ff7a683b5e |
| tree | ae73da38c86fbb8025f1ec7c93b25004f3add618 |
| parent | e16a1f6d945521ff0cd81d6486dbbe86ae7c038f |
5 files changed, 11 insertions(+), 7 deletions(-)
src/common.zig+4-3| ... | ... | @@ -5,6 +5,7 @@ const gpa = std.heap.c_allocator; |
| 5 | 5 | |
| 6 | 6 | const ansi = @import("ansi"); |
| 7 | 7 | |
| 8 | const zigmod = @import("./lib.zig"); | |
| 8 | 9 | const u = @import("./util/index.zig"); |
| 9 | 10 | const yaml = @import("./util/yaml.zig"); |
| 10 | 11 | |
| ... | ... | @@ -123,7 +124,7 @@ pub fn get_modpath(cachepath: string, d: u.Dep, options: *CollectOptions) !strin |
| 123 | 124 | }, |
| 124 | 125 | .git => { |
| 125 | 126 | if (d.version.len > 0) { |
| 126 | const vers = u.parse_split(u.DepType.GitVersion, "-").do(d.version) catch |e| switch (e) { | |
| 127 | const vers = u.parse_split(zigmod.DepType.GitVersion, "-").do(d.version) catch |e| switch (e) { | |
| 127 | 128 | error.IterEmpty => unreachable, |
| 128 | 129 | error.NoMemberFound => { |
| 129 | 130 | const vtype = d.version[0..std.mem.indexOf(u8, d.version, "-").?]; |
| ... | ... | @@ -201,7 +202,7 @@ pub fn get_module_from_dep(d: *u.Dep, cachepath: string, options: *CollectOption |
| 201 | 202 | if (options.lock) |lock| { |
| 202 | 203 | for (lock) |item| { |
| 203 | 204 | if (std.mem.eql(u8, item[0], try d.clean_path())) { |
| 204 | d.type = std.meta.stringToEnum(u.DepType, item[1]).?; | |
| 205 | d.type = std.meta.stringToEnum(zigmod.DepType, item[1]).?; | |
| 205 | 206 | d.path = item[2]; |
| 206 | 207 | d.version = item[3]; |
| 207 | 208 | break; |
| ... | ... | @@ -367,7 +368,7 @@ pub fn parse_lockfile(dir: std.fs.Dir) ![]const [4]string { |
| 367 | 368 | 2 => { |
| 368 | 369 | var iter = std.mem.split(u8, line, " "); |
| 369 | 370 | const asdep = u.Dep{ |
| 370 | .type = std.meta.stringToEnum(u.DepType, iter.next().?).?, | |
| 371 | .type = std.meta.stringToEnum(zigmod.DepType, iter.next().?).?, | |
| 371 | 372 | .path = iter.next().?, |
| 372 | 373 | .version = iter.next().?, |
| 373 | 374 | .id = "", |
src/lib.zig+2| ... | ... | @@ -22,3 +22,5 @@ pub fn init() !void { |
| 22 | 22 | pub fn deinit() void { |
| 23 | 23 | zfetch.deinit(); |
| 24 | 24 | } |
| 25 | ||
| 26 | pub const DepType = @import("./util/dep_type.zig").DepType; |
src/util/dep.zig+3-2| ... | ... | @@ -3,6 +3,7 @@ const string = []const u8; |
| 3 | 3 | const gpa = std.heap.c_allocator; |
| 4 | 4 | const builtin = std.builtin; |
| 5 | 5 | |
| 6 | const zigmod = @import("../lib.zig"); | |
| 6 | 7 | const u = @import("index.zig"); |
| 7 | 8 | const yaml = @import("./yaml.zig"); |
| 8 | 9 | |
| ... | ... | @@ -12,7 +13,7 @@ const yaml = @import("./yaml.zig"); |
| 12 | 13 | pub const Dep = struct { |
| 13 | 14 | const Self = @This(); |
| 14 | 15 | |
| 15 | type: u.DepType, | |
| 16 | type: zigmod.DepType, | |
| 16 | 17 | path: string, |
| 17 | 18 | |
| 18 | 19 | id: string, |
| ... | ... | @@ -65,7 +66,7 @@ pub const Dep = struct { |
| 65 | 66 | } |
| 66 | 67 | return switch (self.type) { |
| 67 | 68 | .git => blk: { |
| 68 | const vers = try u.parse_split(u.DepType.GitVersion, "-").do(self.version); | |
| 69 | const vers = try u.parse_split(zigmod.DepType.GitVersion, "-").do(self.version); | |
| 69 | 70 | if (vers.id.frozen()) break :blk self.version; |
| 70 | 71 | break :blk try self.type.exact_version(dpath); |
| 71 | 72 | }, |
src/util/index.zig-1| ... | ... | @@ -1,5 +1,4 @@ |
| 1 | 1 | usingnamespace @import("./funcs.zig"); |
| 2 | usingnamespace @import("./dep_type.zig"); | |
| 3 | 2 | usingnamespace @import("./dep.zig"); |
| 4 | 3 | usingnamespace @import("./modfile.zig"); |
| 5 | 4 | usingnamespace @import("./module.zig"); |
src/util/modfile.zig+2-1| ... | ... | @@ -1,6 +1,7 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const string = []const u8; |
| 3 | 3 | |
| 4 | const zigmod = @import("../lib.zig"); | |
| 4 | 5 | const u = @import("index.zig"); |
| 5 | 6 | const yaml = @import("./yaml.zig"); |
| 6 | 7 | |
| ... | ... | @@ -94,7 +95,7 @@ pub const ModFile = struct { |
| 94 | 95 | if (version == null) { |
| 95 | 96 | version = ""; |
| 96 | 97 | } |
| 97 | const dep_type = std.meta.stringToEnum(u.DepType, dtype).?; | |
| 98 | const dep_type = std.meta.stringToEnum(zigmod.DepType, dtype).?; | |
| 98 | 99 | if (dep_type == .local) { |
| 99 | 100 | if (path.len > 0) { |
| 100 | 101 | name = path; |