mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2025-09-20 10:07:08 +00:00
More robust checking of age of apt cache
This commit is contained in:
parent
9b2b4f2004
commit
5953485018
|
@ -45,12 +45,11 @@ log "done"
|
||||||
log_empty_line
|
log_empty_line
|
||||||
|
|
||||||
log "Updating APT package list..."
|
log "Updating APT package list..."
|
||||||
last_update_delta_s=$(($(date +%s) - $(date +%s -r /var/cache/apt/pkgcache.bin)))
|
if [[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mmin -5)" ]]; then
|
||||||
if test $last_update_delta_s -gt 300; then
|
|
||||||
sudo apt-fast update > /dev/null
|
sudo apt-fast update > /dev/null
|
||||||
log "done"
|
log "done"
|
||||||
else
|
else
|
||||||
log "skipped (fresh by ${last_update_delta_s} seconds)"
|
log "skipped (fresh within at least 5 minutes)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log_empty_line
|
log_empty_line
|
||||||
|
|
Loading…
Reference in a new issue