pub fn ensure_file_db_synced(
force: bool,
max_age_days: u64,
) -> Result<bool, String>Expand description
What: Attempt a best-effort synchronization of the pacman file database.
Inputs:
force: If true, sync regardless of timestamp. If false, only sync if stale.max_age_days: Maximum age in days before considering the database stale (default: 7).
Output:
- Returns
Ok(true)if sync was performed,Ok(false)if sync was skipped (fresh DB),Errif sync failed.
ยงErrors
- Returns
Errwhenpacman -Fycommand execution fails (I/O error) - Returns
Errwhenpacman -Fyexits with non-zero status
Details:
- Checks timestamp first if
forceis false, only syncing when stale. - Intended to reduce false negatives when later querying remote file lists.