diff options
| author | tv <tv@krebsco.de> | 2026-11-13 04:34:38 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-13 04:34:38 +0000 |
| commit | 268608f1ebb71e3fb89fbd42b29d5a3340962fcb (patch) | |
| tree | 09eb046162e6caa712671eb121274c487cbb921d /pkgs | |
| parent | 42727d7edb237fea54bc49340ae7eb335f6a9fe9 (diff) | |
populate prune: name the target like populating does
Pruning prints the path of each entry it removes, without the target's
user and host, while rsync, when populating, names the target as
user@host:path. Pruning names it the same way, so the lines say which
machine they're about.
Diffstat (limited to 'pkgs')
| -rw-r--r-- | pkgs/populate/default.nix | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/pkgs/populate/default.nix b/pkgs/populate/default.nix index e8d3bdc..d6b3a37 100644 --- a/pkgs/populate/default.nix +++ b/pkgs/populate/default.nix @@ -77,6 +77,15 @@ let fi ''; + # The path on the target, as rsync names it: prefixed by the user and host + # if the target isn't local. + targetName = target: path: + optionalString (!isLocalTarget target) ( + (optionalString (target.user != "") "${target.user}@") + + "${target.host}:" + ) + + path; + # Shell code that removes the entries of the directory dir, a shell word, # that aren't named names. find, unlike a loop reading names, copes with # every name, e.g. ones that end in blanks or contain newlines. Entries of @@ -698,7 +707,8 @@ let ${removeOthers { dir = "."; names = attrNames sources ++ [ ".populate" ]; - log = quote target.path; + # Like populating names the target. + log = quote (targetName target target.path); }} roots=.populate/flake-inputs if test -d "$roots"; then @@ -1388,13 +1398,7 @@ let -rlptD \ ${optionalString config.deleteExcluded /* sh */ "--delete-excluded"} \ "$source_path" \ - ${quote ( - optionalString (!isLocalTarget target) ( - (optionalString (target.user != "") "${target.user}@") + - "${target.host}:" - ) + - target.path - )} \ + ${quote (targetName target target.path)} \ >&2 ''; |
