| author | |
| committer | |
| log | 58a16988c07c79a81598ace7b11975a6b4243a30 |
| tree | 9480db8175ef29f6ee123a466a2bd55860806c50 |
| parent | 773b09ff745c30c0e02b6d4717e0da9cb10b2978 |
| signature |
7 files changed, 35 insertions(+), 40 deletions(-)
deps.zig+1-20| ... | ... | @@ -56,8 +56,6 @@ pub fn fetch(exe: *std.Build.Step.Compile) *std.Build.Step { |
| 56 | 56 | } |
| 57 | 57 | step.dependOn(&GitExactStep.create(b, "https://github.com/marlersoft/zigwin32", "ec98bb4d9eea532320a8551720a9e3ec6de64994").step); |
| 58 | 58 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/arqv-ini", "ab427a4de4f875eaa39ee56a29114fc020431546").step); |
| 59 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/iguanaTLS", "3450aaf3ca47986540e2b0258c2affc45af64ea2").step); | |
| 60 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zfetch", "40d141bf7db81f05a83cce5f2edc4b14e41a5c34").step); | |
| 61 | 59 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-ansi", "5f89211a749aef6bf518889c0467ceb24825c055").step); |
| 62 | 60 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-detect-license", "a1a066da88dab50873a56f0349dc12dc76542077").step); |
| 63 | 61 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-extras", "b3457b31a1d1ea2c19c5d0b007c903d3e80add40").step); |
| ... | ... | @@ -75,7 +73,6 @@ pub fn fetch(exe: *std.Build.Step.Compile) *std.Build.Step { |
| 75 | 73 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-time", "0f4db4c980146e4a3fc86a9a9070452a25ff9317").step); |
| 76 | 74 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-tracer", "3a5fdea4ffd387a53ac2a42fb503557cdbe20696").step); |
| 77 | 75 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-yaml", "00e899bec815bc2b49c6e5a72a7cfeeda673e133").step); |
| 78 | step.dependOn(&GitExactStep.create(b, "https://github.com/truemedian/hzzp", "ab212bd208f0eb54d85861679677c5e3dc9bb543").step); | |
| 79 | 76 | step.dependOn(&GitExactStep.create(b, "https://github.com/madler/zlib", "da607da739fa6047df13e66a2af6b8bec7c2a498").step); |
| 80 | 77 | step.dependOn(&GitExactStep.create(b, "https://github.com/yaml/libyaml", "2c891fc7a770e8ba2fec34fc6b545c672beb37e6").step); |
| 81 | 78 | step.dependOn(&GitExactStep.create(b, "https://github.com/ziglibs/known-folders", "aa24df42183ad415d10bc0a33e6238c437fc0f59").step); |
| ... | ... | @@ -199,11 +196,6 @@ pub const package_data = struct { |
| 199 | 196 | .name = "ini", |
| 200 | 197 | .entry = "/git/github.com/nektro/arqv-ini/ab427a4de4f875eaa39ee56a29114fc020431546/src/ini.zig", |
| 201 | 198 | }; |
| 202 | pub var _csbnipaad8n7 = Package{ | |
| 203 | .store = "/git/github.com/nektro/iguanaTLS/3450aaf3ca47986540e2b0258c2affc45af64ea2", | |
| 204 | .name = "iguanaTLS", | |
| 205 | .entry = "/git/github.com/nektro/iguanaTLS/3450aaf3ca47986540e2b0258c2affc45af64ea2/src/main.zig", | |
| 206 | }; | |
| 207 | 199 | pub var _s84v9o48ucb0 = Package{ |
| 208 | 200 | .store = "/git/github.com/nektro/zig-ansi/5f89211a749aef6bf518889c0467ceb24825c055", |
| 209 | 201 | .name = "ansi", |
| ... | ... | @@ -302,17 +294,6 @@ pub const package_data = struct { |
| 302 | 294 | .entry = "/git/github.com/nektro/zig-yaml/00e899bec815bc2b49c6e5a72a7cfeeda673e133/yaml.zig", |
| 303 | 295 | .deps = &[_]*Package{ &_8mdbh0zuneb0 }, |
| 304 | 296 | }; |
| 305 | pub var _9k24gimke1an = Package{ | |
| 306 | .store = "/git/github.com/truemedian/hzzp/ab212bd208f0eb54d85861679677c5e3dc9bb543", | |
| 307 | .name = "hzzp", | |
| 308 | .entry = "/git/github.com/truemedian/hzzp/ab212bd208f0eb54d85861679677c5e3dc9bb543/src/main.zig", | |
| 309 | }; | |
| 310 | pub var _ejw82j2ipa0e = Package{ | |
| 311 | .store = "/git/github.com/nektro/zfetch/40d141bf7db81f05a83cce5f2edc4b14e41a5c34", | |
| 312 | .name = "zfetch", | |
| 313 | .entry = "/git/github.com/nektro/zfetch/40d141bf7db81f05a83cce5f2edc4b14e41a5c34/src/main.zig", | |
| 314 | .deps = &[_]*Package{ &_9k24gimke1an, &_csbnipaad8n7 }, | |
| 315 | }; | |
| 316 | 297 | pub var _0e2d06bb494b = Package{ |
| 317 | 298 | .store = "/git/github.com/madler/zlib/da607da739fa6047df13e66a2af6b8bec7c2a498", |
| 318 | 299 | .c_include_dirs = &.{ "" }, |
| ... | ... | @@ -333,7 +314,7 @@ pub const package_data = struct { |
| 333 | 314 | pub var _89ujp8gq842x = Package{ |
| 334 | 315 | .name = "zigmod", |
| 335 | 316 | .entry = "/../..//src/lib.zig", |
| 336 | .deps = &[_]*Package{ &_g982zq6e8wsv, &_s84v9o48ucb0, &_2ta738wrqbaq, &_0npcrzfdlrvk, &_ejw82j2ipa0e, &_2ovav391ivak, &_c1xirp1ota5p, &_u7sysdckdymi, &_iecwp4b3bsfm, &_f7dubzb7cyqe, &_0k64oe2nuzvj, &_ocmr9rtohgcc, &_kscsl0145t7x, &_vph9l0hxpeze }, | |
| 317 | .deps = &[_]*Package{ &_g982zq6e8wsv, &_s84v9o48ucb0, &_2ta738wrqbaq, &_0npcrzfdlrvk, &_2ovav391ivak, &_c1xirp1ota5p, &_u7sysdckdymi, &_iecwp4b3bsfm, &_f7dubzb7cyqe, &_0k64oe2nuzvj, &_ocmr9rtohgcc, &_kscsl0145t7x, &_vph9l0hxpeze }, | |
| 337 | 318 | }; |
| 338 | 319 | pub var _root = Package{ |
| 339 | 320 | }; |
licenses.txt-3| ... | ... | @@ -3,8 +3,6 @@ MIT: |
| 3 | 3 | - This |
| 4 | 4 | - git https://github.com/marlersoft/zigwin32 |
| 5 | 5 | - git https://github.com/nektro/arqv-ini |
| 6 | - git https://github.com/nektro/iguanaTLS | |
| 7 | - git https://github.com/nektro/zfetch | |
| 8 | 6 | - git https://github.com/nektro/zig-ansi |
| 9 | 7 | - git https://github.com/nektro/zig-detect-license |
| 10 | 8 | - git https://github.com/nektro/zig-extras |
| ... | ... | @@ -18,7 +16,6 @@ MIT: |
| 18 | 16 | - git https://github.com/nektro/zig-time |
| 19 | 17 | - git https://github.com/nektro/zig-tracer |
| 20 | 18 | - git https://github.com/nektro/zig-yaml |
| 21 | - git https://github.com/truemedian/hzzp | |
| 22 | 19 | - git https://github.com/yaml/libyaml |
| 23 | 20 | - git https://github.com/ziglibs/known-folders |
| 24 | 21 |
src/cmd/zpm.zig+12-3| ... | ... | @@ -1,7 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const string = []const u8; |
| 3 | 3 | const gpa = std.heap.c_allocator; |
| 4 | const zfetch = @import("zfetch"); | |
| 5 | 4 | const extras = @import("extras"); |
| 6 | 5 | const json = @import("json"); |
| 7 | 6 | const nio = @import("nio"); |
| ... | ... | @@ -58,9 +57,19 @@ pub fn execute(self_name: []const u8, args: [][:0]u8) !void { |
| 58 | 57 | } |
| 59 | 58 | |
| 60 | 59 | pub fn server_fetch(url: string) !json.Document { |
| 61 | const req = try zfetch.Request.init(gpa, url, null); | |
| 60 | var buf: [4096]u8 = @splat(0); | |
| 61 | var client: std.http.Client = .{ .allocator = gpa }; | |
| 62 | defer client.deinit(); | |
| 63 | ||
| 64 | var req = try client.open(.GET, try std.Uri.parse(url), .{ | |
| 65 | .server_header_buffer = &buf, | |
| 66 | .redirect_behavior = .not_allowed, | |
| 67 | }); | |
| 62 | 68 | defer req.deinit(); |
| 63 | try req.do(.GET, null, null); | |
| 69 | try req.send(); | |
| 70 | try req.finish(); | |
| 71 | try req.wait(); | |
| 72 | if (req.response.status == .ok) return error.HttpExpected200; | |
| 64 | 73 | return json.parse(gpa, "", nio.AnyReadable.fromStd(&req.reader()), .{ .support_trailing_commas = true, .maximum_depth = 100 }); |
| 65 | 74 | } |
| 66 | 75 |
src/cmd/zpm/add.zig+20-7| ... | ... | @@ -1,6 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const gpa = std.heap.c_allocator; |
| 3 | const zfetch = @import("zfetch"); | |
| 4 | 3 | const extras = @import("extras"); |
| 5 | 4 | const nfs = @import("nfs"); |
| 6 | 5 | |
| ... | ... | @@ -43,19 +42,33 @@ pub fn execute(self_name: []const u8, args: [][:0]u8) !void { |
| 43 | 42 | } |
| 44 | 43 | } |
| 45 | 44 | |
| 45 | var buf: [4096]u8 = @splat(0); | |
| 46 | var client: std.http.Client = .{ .allocator = gpa }; | |
| 47 | defer client.deinit(); | |
| 48 | ||
| 46 | 49 | const has_zigdotmod = blk: { |
| 47 | 50 | const _url = try std.mem.join(gpa, "/", &.{ found.git, "blob", "HEAD", "zig.mod" }); |
| 48 | const _req = try zfetch.Request.init(gpa, _url, null); | |
| 51 | var _req = try client.open(.GET, try std.Uri.parse(_url), .{ | |
| 52 | .server_header_buffer = &buf, | |
| 53 | .redirect_behavior = .not_allowed, | |
| 54 | }); | |
| 49 | 55 | defer _req.deinit(); |
| 50 | try _req.do(.GET, null, null); | |
| 51 | break :blk @intFromEnum(_req.status) == 200; | |
| 56 | try _req.send(); | |
| 57 | try _req.finish(); | |
| 58 | try _req.wait(); | |
| 59 | break :blk _req.response.status == .ok; | |
| 52 | 60 | }; |
| 53 | 61 | const has_zigmodyml = blk: { |
| 54 | 62 | const _url = try std.mem.join(gpa, "/", &.{ found.git, "blob", "HEAD", "zigmod.yml" }); |
| 55 | const _req = try zfetch.Request.init(gpa, _url, null); | |
| 63 | var _req = try client.open(.GET, try std.Uri.parse(_url), .{ | |
| 64 | .server_header_buffer = &buf, | |
| 65 | .redirect_behavior = .not_allowed, | |
| 66 | }); | |
| 56 | 67 | defer _req.deinit(); |
| 57 | try _req.do(.GET, null, null); | |
| 58 | break :blk @intFromEnum(_req.status) == 200; | |
| 68 | try _req.send(); | |
| 69 | try _req.finish(); | |
| 70 | try _req.wait(); | |
| 71 | break :blk _req.response.status == .ok; | |
| 59 | 72 | }; |
| 60 | 73 | |
| 61 | 74 | _, const file = try zigmod.ModFile.openFile(nfs.cwd(), .{ .mode = .read_write }); |
src/lib.zig+2-3| ... | ... | @@ -1,5 +1,4 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | const zfetch = @import("zfetch"); | |
| 3 | 2 | const extras = @import("extras"); |
| 4 | 3 | const root = @import("root"); |
| 5 | 4 | const build_options = root.build_options; |
| ... | ... | @@ -18,11 +17,11 @@ pub const commands = struct { |
| 18 | 17 | }; |
| 19 | 18 | |
| 20 | 19 | pub fn init() !void { |
| 21 | try zfetch.init(); | |
| 20 | // | |
| 22 | 21 | } |
| 23 | 22 | |
| 24 | 23 | pub fn deinit() void { |
| 25 | zfetch.deinit(); | |
| 24 | // | |
| 26 | 25 | } |
| 27 | 26 | |
| 28 | 27 | pub const Dep = @import("./util/dep.zig").Dep; |
zig.mod-1| ... | ... | @@ -15,7 +15,6 @@ dependencies: |
| 15 | 15 | license: MIT |
| 16 | 16 | version: commit-aa24df42183ad415d10bc0a33e6238c437fc0f59 |
| 17 | 17 | - src: git https://github.com/nektro/zig-licenses |
| 18 | - src: git https://github.com/nektro/zfetch | |
| 19 | 18 | - src: git https://github.com/nektro/zig-detect-license |
| 20 | 19 | - src: git https://github.com/nektro/zig-inquirer |
| 21 | 20 | - src: git https://github.com/nektro/arqv-ini |
zigmod.lock-3| ... | ... | @@ -1,8 +1,6 @@ |
| 1 | 1 | 2 |
| 2 | 2 | git https://github.com/marlersoft/zigwin32 commit-ec98bb4d9eea532320a8551720a9e3ec6de64994 |
| 3 | 3 | git https://github.com/nektro/arqv-ini commit-ab427a4de4f875eaa39ee56a29114fc020431546 |
| 4 | git https://github.com/nektro/iguanaTLS commit-3450aaf3ca47986540e2b0258c2affc45af64ea2 | |
| 5 | git https://github.com/nektro/zfetch commit-40d141bf7db81f05a83cce5f2edc4b14e41a5c34 | |
| 6 | 4 | git https://github.com/nektro/zig-ansi commit-5f89211a749aef6bf518889c0467ceb24825c055 |
| 7 | 5 | git https://github.com/nektro/zig-detect-license commit-a1a066da88dab50873a56f0349dc12dc76542077 |
| 8 | 6 | git https://github.com/nektro/zig-extras commit-b3457b31a1d1ea2c19c5d0b007c903d3e80add40 |
| ... | ... | @@ -20,7 +18,6 @@ git https://github.com/nektro/zig-sys-linux commit-f0b155d3627f8c19868be1b2f15d7 |
| 20 | 18 | git https://github.com/nektro/zig-time commit-0f4db4c980146e4a3fc86a9a9070452a25ff9317 |
| 21 | 19 | git https://github.com/nektro/zig-tracer commit-3a5fdea4ffd387a53ac2a42fb503557cdbe20696 |
| 22 | 20 | git https://github.com/nektro/zig-yaml commit-00e899bec815bc2b49c6e5a72a7cfeeda673e133 |
| 23 | git https://github.com/truemedian/hzzp commit-ab212bd208f0eb54d85861679677c5e3dc9bb543 | |
| 24 | 21 | git https://github.com/madler/zlib tag-v1.3.2 |
| 25 | 22 | git https://github.com/yaml/libyaml tag-0.2.5 |
| 26 | 23 | git https://github.com/ziglibs/known-folders commit-aa24df42183ad415d10bc0a33e6238c437fc0f59 |