diff --git a/deps.zig b/deps.zig index 815e47bf9ab2974c2ebbaea1ae89b156aa86ccc7..066a054ad91acae4e2561a528467eba3c1c350e4 100644 --- a/deps.zig +++ b/deps.zig @@ -67,8 +67,8 @@ pub fn fetch(exe: *std.build.LibExeObjStep) void { exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-licenses", "c9b8cbf3565675a056ad4e9b57cb4f84020e7680").step); exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-licenses-text", "3c07c6e4eb0965dafd0b029c632f823631b3169c").step); exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-range", "4b2f12808aa09be4b27a163efc424dd4e0415992").step); - exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-yaml", "e56b9fed6c0afd1c4d29bedc08c3899ffe1165e9").step); exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-time", "12fad367a5282827aad7e12f0e9cd36f672c4010").step); + exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-yaml", "0d17fb99cba338aedc1abac12d78d5e5f04f0b6b").step); exe.step.dependOn(&GitExactStep.create(b, "https://github.com/truemedian/hzzp", "305aca97fce78eb3e787d57691a5eed5512bece7").step); exe.step.dependOn(&GitExactStep.create(b, "https://github.com/ziglibs/known-folders", "fa75e1bc672952efa0cf06160bbd942b47f6d59b").step); exe.step.dependOn(&GitExactStep.create(b, "https://github.com/yaml/libyaml", "2c891fc7a770e8ba2fec34fc6b545c672beb37e6").step); @@ -227,9 +227,9 @@ pub const package_data = struct { .deps = &[_]*Package{ &_f7dubzb7cyqe }, }; pub var _g982zq6e8wsv = Package{ - .store = "/git/github.com/nektro/zig-yaml/e56b9fed6c0afd1c4d29bedc08c3899ffe1165e9", + .store = "/git/github.com/nektro/zig-yaml/0d17fb99cba338aedc1abac12d78d5e5f04f0b6b", .name = "yaml", - .entry = "/git/github.com/nektro/zig-yaml/e56b9fed6c0afd1c4d29bedc08c3899ffe1165e9/yaml.zig", + .entry = "/git/github.com/nektro/zig-yaml/0d17fb99cba338aedc1abac12d78d5e5f04f0b6b/yaml.zig", .deps = &[_]*Package{ &_f7dubzb7cyqe }, }; pub var _9k24gimke1an = Package{ diff --git a/src/cmd/license.zig b/src/cmd/license.zig index 80ba24f23789ca6840d252d27959dc0f94a10fed..703f76d8d99180b9848211e84d71c9250a76feb7 100644 --- a/src/cmd/license.zig +++ b/src/cmd/license.zig @@ -54,7 +54,7 @@ pub fn do(cachepath: string, dir: std.fs.Dir, options: *common.CollectOptions, o try unspecified_list.append(item); continue; } - const license_code = item.yaml.?.get_string("license"); + const license_code = item.yaml.?.get_string("license") orelse ""; if (license_code.len == 0) { try unspecified_list.append(item); continue; diff --git a/src/util/modfile.zig b/src/util/modfile.zig index 083aabb5b22765ebb9f38c99202079ae62c403d3..fdefb1430f0238443cfbe5607b98b5534ca61b91 100644 --- a/src/util/modfile.zig +++ b/src/util/modfile.zig @@ -53,9 +53,9 @@ pub const ModFile = struct { } pub fn from_mapping(alloc: std.mem.Allocator, mapping: yaml.Mapping) !Self { - const id = mapping.get_string("id"); - const name = mapping.get("name").?.string; - const main = mapping.get_string("main"); + const id = mapping.get_string("id") orelse ""; + const name = mapping.get_string("name") orelse ""; + const main = mapping.get_string("main") orelse ""; if (std.mem.indexOf(u8, name, "/")) |_| { u.fail("name may not contain any '/'", .{}); @@ -74,8 +74,8 @@ pub const ModFile = struct { .files = try mapping.get_string_array(alloc, "files"), .rootdeps = try dep_list_by_name(alloc, mapping, &.{ "dev_dependencies", "root_dependencies" }, false), .builddeps = try dep_list_by_name(alloc, mapping, &.{ "dev_dependencies", "build_dependencies" }, true), - .min_zig_version = std.SemanticVersion.parse(mapping.get_string("min_zig_version")) catch null, - .vcpkg = std.mem.eql(u8, "true", mapping.get_string("vcpkg")), + .min_zig_version = std.SemanticVersion.parse(mapping.get_string("min_zig_version") orelse "") catch null, + .vcpkg = std.mem.eql(u8, "true", mapping.get_string("vcpkg") orelse ""), }; } @@ -90,8 +90,8 @@ pub const ModFile = struct { var dtype: string = undefined; var path: string = undefined; var version: ?string = null; - var name = item.mapping.get_string("name"); - var main = item.mapping.get_string("main"); + var name = item.mapping.get_string("name") orelse ""; + var main = item.mapping.get_string("main") orelse ""; if (item.mapping.get("src")) |val| { var src_iter = std.mem.tokenize(u8, val.string, " "); @@ -125,19 +125,19 @@ pub const ModFile = struct { try dep_list.append(zigmod.Dep{ .type = dep_type, .path = path, - .id = item.mapping.get_string("id"), + .id = item.mapping.get_string("id") orelse "", .name = name, .main = main, .version = version.?, .c_include_dirs = try item.mapping.get_string_array(alloc, "c_include_dirs"), .c_source_flags = try item.mapping.get_string_array(alloc, "c_source_flags"), .c_source_files = try item.mapping.get_string_array(alloc, "c_source_files"), - .only_os = try u.list_remove(alloc, try u.split(alloc, item.mapping.get_string("only_os"), ","), ""), - .except_os = try u.list_remove(alloc, try u.split(alloc, item.mapping.get_string("except_os"), ","), ""), + .only_os = try u.list_remove(alloc, try u.split(alloc, item.mapping.get_string("only_os") orelse "", ","), ""), + .except_os = try u.list_remove(alloc, try u.split(alloc, item.mapping.get_string("except_os") orelse "", ","), ""), .yaml = item.mapping, .deps = try dep_list_by_name(alloc, item.mapping, &.{"dependencies"}, for_build), - .keep = std.mem.eql(u8, "true", item.mapping.get_string("keep")), - .vcpkg = std.mem.eql(u8, "true", item.mapping.get_string("vcpkg")), + .keep = std.mem.eql(u8, "true", item.mapping.get_string("keep") orelse ""), + .vcpkg = std.mem.eql(u8, "true", item.mapping.get_string("vcpkg") orelse ""), .for_build = for_build, }); } diff --git a/zigmod.lock b/zigmod.lock index 8180060aa9568d03af9191de979fe4c07b804ba3..51c81438c905bc44fc11adc6b615d90c2b9f31df 100644 --- a/zigmod.lock +++ b/zigmod.lock @@ -12,7 +12,7 @@ git https://github.com/nektro/zig-licenses commit-c9b8cbf3565675a056ad4e9b57cb4f git https://github.com/nektro/zig-licenses-text commit-3c07c6e4eb0965dafd0b029c632f823631b3169c git https://github.com/nektro/zig-range commit-4b2f12808aa09be4b27a163efc424dd4e0415992 git https://github.com/nektro/zig-time commit-12fad367a5282827aad7e12f0e9cd36f672c4010 -git https://github.com/nektro/zig-yaml commit-e56b9fed6c0afd1c4d29bedc08c3899ffe1165e9 +git https://github.com/nektro/zig-yaml commit-0d17fb99cba338aedc1abac12d78d5e5f04f0b6b git https://github.com/truemedian/hzzp commit-305aca97fce78eb3e787d57691a5eed5512bece7 git https://github.com/ziglibs/known-folders commit-fa75e1bc672952efa0cf06160bbd942b47f6d59b git https://github.com/yaml/libyaml tag-0.2.5