From a39ddee552a3955d1655fe89620daa31d9875d16 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 13 Nov 2026 20:33:24 +0000 Subject: populate: give sizes in rsync's log in units of 1024 rsync gives sizes in units of 1000 for two apostrophes, and in units of 1024 for three, which the shell implementation asks for. rsync-units checks it. --- pkgs/populate/docs/design.md | 3 ++- pkgs/populate/src/rsync.rs | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'pkgs') diff --git a/pkgs/populate/docs/design.md b/pkgs/populate/docs/design.md index 7e68fdb..89bf581 100644 --- a/pkgs/populate/docs/design.md +++ b/pkgs/populate/docs/design.md @@ -120,7 +120,8 @@ replacing the Git work tree 'host:/var/src/x', because ... A target path in a message starts with `user@host:` for remote targets, without `user@` if the user is root or not set, and is a plain path for the local target. Errors start with `error:` or `krops:`, warnings with -`warning:`. rsync's itemized changes appear as `%i %n%L %b/%l`. +`warning:`. rsync's itemized changes appear as `%i %n%L %'''b/%'''l`, with sizes in +units of 1024. ## Safety diff --git a/pkgs/populate/src/rsync.rs b/pkgs/populate/src/rsync.rs index dd61b03..78022ab 100644 --- a/pkgs/populate/src/rsync.rs +++ b/pkgs/populate/src/rsync.rs @@ -108,10 +108,11 @@ pub fn transfer(context: &Context, config: &Config, source_path: &str, path: &st command.arg("--insecure-links"); } // Each item gets logged with what changed about it, and its size, as - // transferred and in total. + // transferred and in total, in units of 1024, which three apostrophes + // ask for. command .arg("--itemize-changes") - .arg("--out-format=%i %n%L %''b/%''l") + .arg("--out-format=%i %n%L %'''b/%'''l") .arg("--info=backup,del,copy,misc,mount,name,nonreg,remove,skip,symsafe") // Nothing relies on the times of directories and symlinks, and // keeping them would log a line for each directory changed. -- cgit v1.3.1