pub fn check_sync_db_freshness(
ctx: &GuardrailContext,
now: SystemTime,
) -> Option<GuardrailIssue>Expand description
What: Check whether the pacman sync databases are stale.
Inputs:
ctx: Guardrail context providing the sync directory and staleness window.now: Reference time (injectable for tests).
Output:
Some(GuardrailIssue::SyncDbStale)when the newest*.dbis older than the window.
Details:
- Stale databases correlate with mirror/database drift (“partial upgrade” errors, 404s during download); the guidance is to refresh before mutating.
- Returns
Nonewhen the directory or usable mtimes are unavailable.