diff options
Diffstat (limited to 'debian/apt.cron.daily')
-rw-r--r-- | debian/apt.cron.daily | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/debian/apt.cron.daily b/debian/apt.cron.daily index 6f6dc92a4..4d1bbf085 100644 --- a/debian/apt.cron.daily +++ b/debian/apt.cron.daily @@ -327,12 +327,14 @@ check_power(){ # ------------------------ main ---------------------------- -# Backup the 7 last versions of APT's extended_states file -# shameless copy from dpkg cron -if cd /var/backups ; then - if ! cmp -s apt.extended_states.0 /var/lib/apt/extended_states; then - cp -p /var/lib/apt/extended_states apt.extended_states - savelog -c 7 apt.extended_states >/dev/null +if test -r /var/lib/apt/extended_states; then + # Backup the 7 last versions of APT's extended_states file + # shameless copy from dpkg cron + if cd /var/backups ; then + if ! cmp -s apt.extended_states.0 /var/lib/apt/extended_states; then + cp -p /var/lib/apt/extended_states apt.extended_states + savelog -c 7 apt.extended_states >/dev/null + fi fi fi @@ -434,6 +436,13 @@ fi UPDATED=0 UPDATE_STAMP=/var/lib/apt/periodic/update-stamp if check_stamp $UPDATE_STAMP $UpdateInterval; then + # check for a new archive signing key (against the master keyring) + if eval apt-key net-update $XSTDERR; then + debug_echo "apt-key net-update (success)" + else + debug_echo "apt-key net-update (failure)" + fi + # run apt-get update if eval apt-get $XAPTOPT -y update $XSTDERR; then debug_echo "download updated metadata (success)." if which dbus-send >/dev/null && pidof dbus-daemon >/dev/null; then @@ -447,6 +456,11 @@ if check_stamp $UPDATE_STAMP $UpdateInterval; then fi update_stamp $UPDATE_STAMP UPDATED=1 + # now run apt-xapian-index if it is installed to ensure the index + # is up-to-date + if [ -x /usr/sbin/update-apt-xapian-index ]; then + nice ionice -c3 update-apt-xapian-index -q -u + fi else debug_echo "download updated metadata (error)" fi |