From 3aff9c58c68d6882294e6586ddb384709ce95abe Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Dec 2026 02:47:32 +0000 Subject: populate: probe passage and pass sources too A passage source ran rsync on every run, about a dozen round trips to a remote target, and a pass source a command reading .pass_info, which tells whether the passwords changed. The probe lists the target paths of passage sources too, and reads what pass sources' .pass_info contains. After decrypting, a passage source lists its working directory with find, whose files have the times of their .age files and fixed modes, and doesn't run rsync if the listings are the same; Delivery::transfer does that for any source the probe listed. A pass source takes .pass_info from the probe. --- pkgs/populate/src/sh.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'pkgs/populate/src/sh.rs') diff --git a/pkgs/populate/src/sh.rs b/pkgs/populate/src/sh.rs index dc44854..9d2b1d4 100644 --- a/pkgs/populate/src/sh.rs +++ b/pkgs/populate/src/sh.rs @@ -347,13 +347,14 @@ fi /// probe KIND PATH...: prints, for each pair of KIND and PATH, what /// probe::Target takes from it: P and PATH, then, for KIND F, an entry like /// listings prints for each thing at and below PATH, for L, if PATH is a -/// symlink, L and its target, and for G, if PATH is a directory with a .git -/// directory that git_problems finds nothing wrong with, C, H and HEAD, U and -/// the origin's URL, D and what git status prints for anything modified, -/// untracked, or ignored, and, with submodules, M and what git submodule -/// status prints for them, and S and an exit status, all separated by NULs. -/// Git runs like the git script runs it, without hooks and file system -/// monitors, and without writing the index. +/// symlink, L and its target, for I, I and what PATH/.pass_info contains, +/// if anything, like pass_info prints it, and for G, if PATH is a directory +/// with a .git directory that git_problems finds nothing wrong with, C, H +/// and HEAD, U and the origin's URL, D and what git status prints for +/// anything modified, untracked, or ignored, and, with submodules, M and +/// what git submodule status prints for them, and S and an exit status, +/// all separated by NULs. Git runs like the git script runs it, without +/// hooks and file system monitors, and without writing the index. pub fn probe() -> String { GIT_PROBLEMS.to_string() + r#" @@ -377,6 +378,9 @@ while test $# -gt 1; do printf 'L\0%s\0' "$(readlink "$path")" fi ;; + I) + printf 'I\0%s\0' "$(cat "$path"/.pass_info 2>/dev/null || :)" + ;; G) if ! test -L "$path" && test -d "$path" && ! test -L "$path"/.git && test -d "$path"/.git && -- cgit v1.3.1 [cgit] Unable to lock slot /tmp/cgit/df100000.lock: Permission denied (13)