From e81592e76f48c850a0ef35b8048260c21306a4b2 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 20 Nov 2026 05:19:21 +0000 Subject: populate: get what the target lacks from its populate runs findutils, flock, rsync, patch, and Git on the target, as the sources need them. check looks for those first, and if any isn't there, it warns, and gets their packages from the target's with one nix-build, whose bin directories commands on the target, and rsync's remote end, find commands in before those in their PATH, for the rest of the run. If the target is the machine populate runs on, that goes for populate as well. --- pkgs/populate/src/rsync.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'pkgs/populate/src/rsync.rs') diff --git a/pkgs/populate/src/rsync.rs b/pkgs/populate/src/rsync.rs index 05eb126..f943d0e 100644 --- a/pkgs/populate/src/rsync.rs +++ b/pkgs/populate/src/rsync.rs @@ -106,9 +106,15 @@ pub fn transfer( if config.use_checksum { command.arg("--checksum"); } - if context.target.sudo { - command.arg("--rsync-path=sudo rsync"); - } + // The remote shell runs it as a command. + let sudo = if context.target.sudo { "sudo " } else { "" }; + match context.path() { + Some(path) => command.arg(format!( + "--rsync-path={sudo}env PATH={path}:\"$PATH\" rsync" + )), + None if context.target.sudo => command.arg("--rsync-path=sudo rsync"), + None => &mut command, + }; command.arg("-e").arg(&context.ssh).arg("--protect-args"); if insecure_links { command.arg("--insecure-links"); -- cgit v1.3.1