authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-08-25 00:25:48 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-08-25 00:25:48 -07:00
log7ef751ed074ac1b6b70f0e0f5aa56047cfb4895e
tree7a51e4243af908d3622e97de1dcf4e36b523fda9
parent6ff661c8e810cad315325aa7e4a682b35c164111

cmd/fetch- remove parent module from logging


3 files changed, 12 insertions(+), 12 deletions(-)

src/cmd/aquila/install.zig+1-1
......@@ -46,7 +46,7 @@ pub fn execute(args: [][]u8) !void {
4646 .update = false,
4747 };
4848 try fetchoptions.init();
49 const modpath = try common.get_modpath(cachepath, dep, "install", &fetchoptions);
49 const modpath = try common.get_modpath(cachepath, dep, &fetchoptions);
5050 const moddir = try std.fs.cwd().openDir(modpath, .{});
5151
5252 // zigmod ci
src/common.zig+10-10
......@@ -34,11 +34,11 @@ pub fn collect_deps_deep(cachepath: []const u8, mdir: std.fs.Dir, options: *Coll
3434 defer moduledeps.deinit();
3535 if (m.root_files.len > 0) {
3636 try std.fs.cwd().makePath(".zigmod/deps/files");
37 try moduledeps.append(try add_files_package("root", m.root_files, m.name));
37 try moduledeps.append(try add_files_package("root", m.root_files));
3838 }
3939 try moduledeps.append(try collect_deps(cachepath, mdir, options));
4040 for (m.devdeps) |*d| {
41 if (try get_module_from_dep(d, cachepath, m.name, options)) |founddep| {
41 if (try get_module_from_dep(d, cachepath, options)) |founddep| {
4242 try moduledeps.append(founddep);
4343 }
4444 }
......@@ -60,10 +60,10 @@ pub fn collect_deps(cachepath: []const u8, mdir: std.fs.Dir, options: *CollectOp
6060 defer moduledeps.deinit();
6161 if (m.files.len > 0) {
6262 try std.fs.cwd().makePath(".zigmod/deps/files");
63 try moduledeps.append(try add_files_package(m.id, m.files, m.name));
63 try moduledeps.append(try add_files_package(m.id, m.files));
6464 }
6565 for (m.deps) |*d| {
66 if (try get_module_from_dep(d, cachepath, m.name, options)) |founddep| {
66 if (try get_module_from_dep(d, cachepath, options)) |founddep| {
6767 try moduledeps.append(founddep);
6868 }
6969 }
......@@ -92,7 +92,7 @@ pub fn collect_pkgs(mod: u.Module, list: *std.ArrayList(u.Module)) anyerror!void
9292 }
9393}
9494
95pub fn get_modpath(cachepath: []const u8, d: u.Dep, parent_name: []const u8, options: *CollectOptions) ![]const u8 {
95pub fn get_modpath(cachepath: []const u8, d: u.Dep, options: *CollectOptions) ![]const u8 {
9696 const p = try std.fs.path.join(gpa, &.{ cachepath, try d.clean_path() });
9797 const pv = try std.fs.path.join(gpa, &.{ cachepath, try d.clean_path_v() });
9898
......@@ -101,7 +101,7 @@ pub fn get_modpath(cachepath: []const u8, d: u.Dep, parent_name: []const u8, opt
101101 if (!nocache and u.list_contains(options.already_fetched.items, pv)) return pv;
102102
103103 if (options.log and d.type != .local) {
104 u.print("fetch: {s}: {s}: {s}", .{ parent_name, @tagName(d.type), d.path });
104 u.print("fetch: {s}: {s}", .{ @tagName(d.type), d.path });
105105 }
106106 defer {
107107 if (!bootstrap and options.log and d.type != .local) {
......@@ -197,7 +197,7 @@ pub fn get_modpath(cachepath: []const u8, d: u.Dep, parent_name: []const u8, opt
197197 }
198198}
199199
200pub fn get_module_from_dep(d: *u.Dep, cachepath: []const u8, parent_name: []const u8, options: *CollectOptions) anyerror!?u.Module {
200pub fn get_module_from_dep(d: *u.Dep, cachepath: []const u8, options: *CollectOptions) anyerror!?u.Module {
201201 if (options.lock) |lock| {
202202 for (lock) |item| {
203203 if (std.mem.eql(u8, item[0], try d.clean_path())) {
......@@ -208,7 +208,7 @@ pub fn get_module_from_dep(d: *u.Dep, cachepath: []const u8, parent_name: []cons
208208 }
209209 }
210210 }
211 const modpath = try get_modpath(cachepath, d.*, parent_name, options);
211 const modpath = try get_modpath(cachepath, d.*, options);
212212 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, .{});
213213
214214 const nocache = d.type == .local or d.type == .system_lib;
......@@ -276,7 +276,7 @@ pub fn get_module_from_dep(d: *u.Dep, cachepath: []const u8, parent_name: []cons
276276 }
277277}
278278
279pub fn add_files_package(pkg_name: []const u8, dirs: []const []const u8, parent_name: []const u8) !u.Module {
279pub fn add_files_package(pkg_name: []const u8, dirs: []const []const u8) !u.Module {
280280 const destination = ".zigmod/deps/files";
281281 const fname = try std.mem.join(gpa, "", &.{ pkg_name, ".zig" });
282282
......@@ -335,7 +335,7 @@ pub fn add_files_package(pkg_name: []const u8, dirs: []const []const u8, parent_
335335 .log = false,
336336 .update = false,
337337 };
338 return (try get_module_from_dep(&d, destination, parent_name, &options)).?;
338 return (try get_module_from_dep(&d, destination, &options)).?;
339339}
340340
341341pub fn parse_lockfile(dir: std.fs.Dir) ![]const [4][]const u8 {
src/util/module.zig+1-1
......@@ -28,7 +28,7 @@ pub const Module = struct {
2828 var moddeps = std.ArrayList(Module).init(gpa);
2929 defer moddeps.deinit();
3030 for (dep.deps) |*d| {
31 if (try common.get_module_from_dep(d, dir, dep.name, options)) |founddep| {
31 if (try common.get_module_from_dep(d, dir, options)) |founddep| {
3232 try moddeps.append(founddep);
3333 }
3434 }