authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-09-01 13:20:31 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-09-14 12:53:02 -07:00
log616dbac916275fa0051306a384eb64cf983287be
treef181588f1569ce43889918c7f66c29e84a9417f9
parent6b02ffbc2aba254561d42f158c5b0b52daed9e22

zigmod.lock: alphabetize the list of dependencies to be order independent


3 files changed, 25 insertions(+), 14 deletions(-)

src/cmd/fetch.zig+2
...@@ -141,6 +141,8 @@ fn create_lockfile(alloc: std.mem.Allocator, list: *std.ArrayList(zigmod.Module)...@@ -141,6 +141,8 @@ fn create_lockfile(alloc: std.mem.Allocator, list: *std.ArrayList(zigmod.Module)
141 const fl = try dir.createFile("zigmod.lock", .{});141 const fl = try dir.createFile("zigmod.lock", .{});
142 defer fl.close();142 defer fl.close();
143143
144 std.sort.sort(zigmod.Module, list.items, {}, zigmod.Module.lessThan);
145
144 const wl = fl.writer();146 const wl = fl.writer();
145 try wl.writeAll("2\n");147 try wl.writeAll("2\n");
146 for (list.items) |m| {148 for (list.items) |m| {
src/util/module.zig+9
...@@ -150,4 +150,13 @@ pub const Module = struct {...@@ -150,4 +150,13 @@ pub const Module = struct {
150 }150 }
151 return res;151 return res;
152 }152 }
153
154 pub fn lessThan(_: void, lhs: Module, rhs: Module) bool {
155 for (lhs.clean_path) |_, i| {
156 if (i == rhs.clean_path.len) return false;
157 if (lhs.clean_path[i] < rhs.clean_path[i]) return true;
158 if (lhs.clean_path[i] > rhs.clean_path[i]) return false;
159 }
160 return false;
161 }
153};162};
zigmod.lock+14-14
...@@ -1,19 +1,19 @@...@@ -1,19 +1,19 @@
1212
2git https://github.com/yaml/libyaml tag-0.2.5
3git https://github.com/nektro/zig-ansi commit-d4a53bcac5b87abecc65491109ec22aaf5f3dc2f
4git https://github.com/ziglibs/known-folders commit-24845b0103e611c108d6bc334231c464e699742c
5git https://github.com/nektro/zig-licenses commit-c9b8cbf3565675a056ad4e9b57cb4f84020e7680
6git https://github.com/truemedian/zfetch commit-12b1374aae32e8ebf719a096a22cdf4c49433458
7git https://github.com/truemedian/hzzp commit-d4fbade2d806fc93bc5f79ec8efdcc25ea625fa3
8git https://github.com/nektro/iguanaTLS commit-09d9fe92f329484536dfb2b07cfa8b406151cde4
9git https://github.com/MasterQ32/zig-uri commit-e879df3a236869f92298fbe2db3c25e6e84cfd4c2git https://github.com/MasterQ32/zig-uri commit-e879df3a236869f92298fbe2db3c25e6e84cfd4c
10git https://github.com/nektro/zig-json commit-a091eaa9f9ae91c3875630ba1983b33ea04971a33git https://github.com/marlersoft/zigwin32 commit-2b40704fbc2c9fbdb6f31acbc48684b6b98c15e3
11git https://github.com/nektro/zig-extras commit-01fae956e2f17aa992e717e041a3dd457d440b314git https://github.com/nektro/arqv-ini commit-1a9b2e90379895e197893b6e19c93bd213ad36e6
12git https://github.com/nektro/zig-range commit-4b2f12808aa09be4b27a163efc424dd4e04159925git https://github.com/nektro/iguanaTLS commit-09d9fe92f329484536dfb2b07cfa8b406151cde4
6git https://github.com/nektro/zig-ansi commit-d4a53bcac5b87abecc65491109ec22aaf5f3dc2f
13git https://github.com/nektro/zig-detect-license commit-de5c285d999eea68b9189b48bb000243fef0a6897git https://github.com/nektro/zig-detect-license commit-de5c285d999eea68b9189b48bb000243fef0a689
14git https://github.com/nektro/zig-licenses-text commit-3c07c6e4eb0965dafd0b029c632f823631b3169c8git https://github.com/nektro/zig-extras commit-01fae956e2f17aa992e717e041a3dd457d440b31
15git https://github.com/nektro/zig-leven commit-ab852cf74fa0b4edc530d925f0654b62c60365bf
16git https://github.com/nektro/zig-inquirer commit-14c3492c46f9765c3e77436741794d1a3118cbee9git https://github.com/nektro/zig-inquirer commit-14c3492c46f9765c3e77436741794d1a3118cbee
17git https://github.com/nektro/arqv-ini commit-1a9b2e90379895e197893b6e19c93bd213ad36e610git https://github.com/nektro/zig-json commit-a091eaa9f9ae91c3875630ba1983b33ea04971a3
11git https://github.com/nektro/zig-leven commit-ab852cf74fa0b4edc530d925f0654b62c60365bf
12git https://github.com/nektro/zig-licenses commit-c9b8cbf3565675a056ad4e9b57cb4f84020e7680
13git https://github.com/nektro/zig-licenses-text commit-3c07c6e4eb0965dafd0b029c632f823631b3169c
14git https://github.com/nektro/zig-range commit-4b2f12808aa09be4b27a163efc424dd4e0415992
18git https://github.com/nektro/zig-time commit-a22054de725ef19b3f91b9ad960d4093f852b7e015git https://github.com/nektro/zig-time commit-a22054de725ef19b3f91b9ad960d4093f852b7e0
19git https://github.com/marlersoft/zigwin32 commit-2b40704fbc2c9fbdb6f31acbc48684b6b98c15e316git https://github.com/truemedian/hzzp commit-d4fbade2d806fc93bc5f79ec8efdcc25ea625fa3
17git https://github.com/truemedian/zfetch commit-12b1374aae32e8ebf719a096a22cdf4c49433458
18git https://github.com/ziglibs/known-folders commit-24845b0103e611c108d6bc334231c464e699742c
19git https://github.com/yaml/libyaml tag-0.2.5