aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/populate/src/probe.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-12-01 02:47:32 +0000
committertv <tv@krebsco.de>2026-12-01 04:06:17 +0000
commit3aff9c58c68d6882294e6586ddb384709ce95abe (patch)
treef7f7d13dec077dc21858f56a3a990c483f5f22c8 /pkgs/populate/src/probe.rs
parentcf26dc1f928e9839123bedd1693d792bbb418312 (diff)
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.
Diffstat (limited to 'pkgs/populate/src/probe.rs')
-rw-r--r--pkgs/populate/src/probe.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/populate/src/probe.rs b/pkgs/populate/src/probe.rs
index 7228cd2..3da117a 100644
--- a/pkgs/populate/src/probe.rs
+++ b/pkgs/populate/src/probe.rs
@@ -1,7 +1,8 @@
//! What's at the target paths of the sources whose delivery may find
//! nothing to do, found out with one command on the target, right after
-//! taking the lock, so their delivery doesn't need any: file sources, see
-//! rsync's Listing, symlink sources, and git sources with a commit as ref.
+//! taking the lock, so their delivery doesn't need any: file and passage
+//! sources, see rsync's Listing, symlink and pass sources, and git sources
+//! with a commit as ref.
use crate::rsync::{self, Listing};
use crate::run::{Context, Result};
@@ -12,10 +13,13 @@ use std::collections::BTreeMap;
/// What the probe found at a source's target path.
#[derive(Debug, Default, PartialEq)]
pub struct Target {
- /// For a file source, its listing, if populate can compare it.
+ /// For a file or passage source, its listing, if populate can compare
+ /// it.
pub listing: Option<Listing>,
/// For a symlink source, the target of the symlink there, if any.
pub link: Option<String>,
+ /// For a pass source, what its .pass_info contains, if anything.
+ pub info: Option<String>,
/// For a git source, the state of the work tree there, if it's one
/// that git_problems finds nothing wrong with.
pub git: Option<Git>,
@@ -125,6 +129,7 @@ fn parse(output: &str) -> BTreeMap<String, Target> {
}
}
"L" => target.link = fields.next().map(str::to_string),
+ "I" => target.info = fields.next().map(str::to_string),
// Dirty until git status says otherwise.
"C" => {
fields.next();
[cgit] Unable to lock slot /tmp/cgit/1b000000.lock: Permission denied (13)