aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/populate/src/sh.rs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/populate/src/sh.rs')
-rw-r--r--pkgs/populate/src/sh.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/pkgs/populate/src/sh.rs b/pkgs/populate/src/sh.rs
index 52d41ac..f29b1f1 100644
--- a/pkgs/populate/src/sh.rs
+++ b/pkgs/populate/src/sh.rs
@@ -344,6 +344,24 @@ fi
"#
}
+/// listings PATH...: prints, for each PATH, P and PATH, an entry for each
+/// thing at and below PATH, with E, mode, size, modification time in
+/// seconds since the epoch, path relative to PATH, and symlink target,
+/// and S and find's exit status, all separated by NULs, so any path comes
+/// through. rsync::found reads it. find follows no symlinks, also not
+/// PATH itself, so a symlink at PATH shows as such.
+pub const LISTINGS: &str = r#"
+for path; do
+ printf 'P\0%s\0' "$path"
+ if find "$path" -printf 'E\0%M\0%s\0%T@\0%P\0%l\0' 2>/dev/null; then
+ status=0
+ else
+ status=$?
+ fi
+ printf 'S\0%s\0' "$status"
+done
+"#;
+
/// symlink PATH TARGET: makes PATH a symlink to TARGET, printing changed
/// if it wasn't one. What else is at PATH, e.g. the Git work tree of a
/// source that had another type, gets removed first: ln -f replaces files