aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/populate/src/flake_input.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-20 01:48:55 +0000
committertv <tv@krebsco.de>2026-11-20 01:48:55 +0000
commit7837a236e728988fcd501917444828b790c367f9 (patch)
treef2f3b91ffe0fd7f60f71f12c5f4f871c92916665 /pkgs/populate/src/flake_input.rs
parentf02b09eae7e806f2fe9caa26b4975b94351d7e27 (diff)
populate: lock files rewritten in place change only if they differ
A file or git source whose lock file the flakes step rewrites in place gets the original back from delivering it, on every run, from rsync, or from git reset, which also printed HEAD is now at, and Nix printed that it updates the lock file, so the record said the source changed on every run. Populate keeps a copy of the rewritten lock file in .populate/locks/<name>, and the flakes step compares with it, printing what Nix says about the lock file, and changed, only if it differs. Delivering such a source doesn't count bringing back the lock file: rsync returns the paths of what it changed, and the git source's script takes the lock file's path, and resets quietly if that's all that differs. relock also checks that the second, unchanged, run prints nothing about lock files, and says nothing changed, now for rewriting in place too.
Diffstat (limited to 'pkgs/populate/src/flake_input.rs')
-rw-r--r--pkgs/populate/src/flake_input.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/populate/src/flake_input.rs b/pkgs/populate/src/flake_input.rs
index b38965d..9763ade 100644
--- a/pkgs/populate/src/flake_input.rs
+++ b/pkgs/populate/src/flake_input.rs
@@ -595,7 +595,7 @@ fn upload_patches(
&dir.to_string_lossy(),
&format!("{sentinel}/patches/{name}"),
)
- .map(|_| ())
+ .map(drop)
}
/// Uploads the flake itself to a target that can't fetch it, unless the
@@ -615,7 +615,7 @@ fn upload_self(context: &Context, name: &str, sentinel: &str, self_path: &str) -
.join("flake-uploads")
.join(name)
.join("tree");
- rsync::transfer(context, &config, self_path, &upload.to_string_lossy()).map(|_| ())
+ rsync::transfer(context, &config, self_path, &upload.to_string_lossy()).map(drop)
}
#[cfg(test)]