diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-02-26 04:01:28 -0800 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-02-26 11:42:04 -0800 |
| commit | de43f5eb6ae4a569efe15e3469b3de76a86d9cd1 (patch) | |
| tree | dca7d9277507de70c93ec5f7fc95425995231e59 /src/main.zig | |
| parent | 67904e925d2b33c48dda3d4ddaf158328964dc2e (diff) | |
| download | zig-de43f5eb6ae4a569efe15e3469b3de76a86d9cd1.tar.gz zig-de43f5eb6ae4a569efe15e3469b3de76a86d9cd1.zip | |
rename "nonce" to "fingerprint"
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/main.zig b/src/main.zig index 3dc6155db6..7b1bc50bd6 100644 --- a/src/main.zig +++ b/src/main.zig @@ -4752,10 +4752,10 @@ fn cmdInit(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { }; var ok_count: usize = 0; - const nonce: Package.Nonce = .generate(sanitized_root_name); + const fingerprint: Package.Fingerprint = .generate(sanitized_root_name); for (template_paths) |template_path| { - if (templates.write(arena, fs.cwd(), sanitized_root_name, template_path, nonce)) |_| { + if (templates.write(arena, fs.cwd(), sanitized_root_name, template_path, fingerprint)) |_| { std.log.info("created {s}", .{template_path}); ok_count += 1; } else |err| switch (err) { @@ -5225,7 +5225,7 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { .job_queue = &job_queue, .omit_missing_hash_error = true, .allow_missing_paths_field = false, - .allow_missing_nonce = false, + .allow_missing_fingerprint = false, .allow_name_string = false, .use_latest_commit = false, @@ -7127,7 +7127,7 @@ fn cmdFetch( .job_queue = &job_queue, .omit_missing_hash_error = true, .allow_missing_paths_field = false, - .allow_missing_nonce = true, + .allow_missing_fingerprint = true, .allow_name_string = true, .use_latest_commit = true, @@ -7468,10 +7468,10 @@ fn loadManifest( 0, ) catch |err| switch (err) { error.FileNotFound => { - const nonce: Package.Nonce = .generate(options.root_name); + const fingerprint: Package.Fingerprint = .generate(options.root_name); var templates = findTemplates(gpa, arena); defer templates.deinit(); - templates.write(arena, options.dir, options.root_name, Package.Manifest.basename, nonce) catch |e| { + templates.write(arena, options.dir, options.root_name, Package.Manifest.basename, fingerprint) catch |e| { fatal("unable to write {s}: {s}", .{ Package.Manifest.basename, @errorName(e), }); @@ -7529,7 +7529,7 @@ const Templates = struct { out_dir: fs.Dir, root_name: []const u8, template_path: []const u8, - nonce: Package.Nonce, + fingerprint: Package.Fingerprint, ) !void { if (fs.path.dirname(template_path)) |dirname| { out_dir.makePath(dirname) catch |err| { @@ -7555,9 +7555,9 @@ const Templates = struct { try templates.buffer.appendSlice(root_name); i += ".NAME".len; continue; - } else if (std.mem.startsWith(u8, contents[i..], ".NONCE")) { - try templates.buffer.writer().print("0x{x}", .{nonce.int()}); - i += ".NONCE".len; + } else if (std.mem.startsWith(u8, contents[i..], ".FINGERPRINT")) { + try templates.buffer.writer().print("0x{x}", .{fingerprint.int()}); + i += ".FINGERPRINT".len; continue; } else if (std.mem.startsWith(u8, contents[i..], ".ZIGVER")) { try templates.buffer.appendSlice(build_options.version); |
