|
@@ -335,7 +335,7 @@ if which on_ac_power >/dev/null; then
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
# check if we can lock the cache and if the cache is clean
|
|
# check if we can lock the cache and if the cache is clean
|
|
|
-if which apt-get >/dev/null && ! eval apt-get check $XAPTOPT $XSTDERR ; then
|
|
|
|
|
|
|
+if which apt-get >/dev/null && ! eval apt-get check -f $XAPTOPT $XSTDERR ; then
|
|
|
debug_echo "error encountered in cron job with \"apt-get check\"."
|
|
debug_echo "error encountered in cron job with \"apt-get check\"."
|
|
|
exit 0
|
|
exit 0
|
|
|
fi
|
|
fi
|
|
@@ -378,6 +378,7 @@ do_cache_backup $BackupArchiveInterval
|
|
|
random_sleep
|
|
random_sleep
|
|
|
|
|
|
|
|
# update package lists
|
|
# update package lists
|
|
|
|
|
+UPDATED=0
|
|
|
UPDATE_STAMP=/var/lib/apt/periodic/update-stamp
|
|
UPDATE_STAMP=/var/lib/apt/periodic/update-stamp
|
|
|
if check_stamp $UPDATE_STAMP $UpdateInterval; then
|
|
if check_stamp $UPDATE_STAMP $UpdateInterval; then
|
|
|
if eval apt-get $XAPTOPT -y update $XSTDERR; then
|
|
if eval apt-get $XAPTOPT -y update $XSTDERR; then
|
|
@@ -392,6 +393,7 @@ if check_stamp $UPDATE_STAMP $UpdateInterval; then
|
|
|
debug_echo "dbus signal not send (command not available)"
|
|
debug_echo "dbus signal not send (command not available)"
|
|
|
fi
|
|
fi
|
|
|
update_stamp $UPDATE_STAMP
|
|
update_stamp $UPDATE_STAMP
|
|
|
|
|
+ UPDATED=1
|
|
|
else
|
|
else
|
|
|
debug_echo "download updated metadata (error)"
|
|
debug_echo "download updated metadata (error)"
|
|
|
fi
|
|
fi
|
|
@@ -401,7 +403,7 @@ fi
|
|
|
|
|
|
|
|
# download all upgradeable packages (if it is requested)
|
|
# download all upgradeable packages (if it is requested)
|
|
|
DOWNLOAD_UPGRADEABLE_STAMP=/var/lib/apt/periodic/download-upgradeable-stamp
|
|
DOWNLOAD_UPGRADEABLE_STAMP=/var/lib/apt/periodic/download-upgradeable-stamp
|
|
|
-if check_stamp $DOWNLOAD_UPGRADEABLE_STAMP $DownloadUpgradeableInterval; then
|
|
|
|
|
|
|
+if [ $UPDATED -eq 1 ] && check_stamp $DOWNLOAD_UPGRADEABLE_STAMP $DownloadUpgradeableInterval; then
|
|
|
if eval apt-get $XAPTOPT -y -d dist-upgrade $XSTDERR; then
|
|
if eval apt-get $XAPTOPT -y -d dist-upgrade $XSTDERR; then
|
|
|
update_stamp $DOWNLOAD_UPGRADEABLE_STAMP
|
|
update_stamp $DOWNLOAD_UPGRADEABLE_STAMP
|
|
|
debug_echo "download upgradable (success)"
|
|
debug_echo "download upgradable (success)"
|
|
@@ -414,7 +416,7 @@ fi
|
|
|
|
|
|
|
|
# auto upgrade all upgradeable packages
|
|
# auto upgrade all upgradeable packages
|
|
|
UPGRADE_STAMP=/var/lib/apt/periodic/upgrade-stamp
|
|
UPGRADE_STAMP=/var/lib/apt/periodic/upgrade-stamp
|
|
|
-if which unattended-upgrade >/dev/null && check_stamp $UPGRADE_STAMP $UnattendedUpgradeInterval; then
|
|
|
|
|
|
|
+if [ $UPDATED -eq 1 ] && which unattended-upgrade >/dev/null && check_stamp $UPGRADE_STAMP $UnattendedUpgradeInterval; then
|
|
|
if unattended-upgrade $XUUPOPT; then
|
|
if unattended-upgrade $XUUPOPT; then
|
|
|
update_stamp $UPGRADE_STAMP
|
|
update_stamp $UPGRADE_STAMP
|
|
|
debug_echo "unattended-upgrade (success)"
|
|
debug_echo "unattended-upgrade (success)"
|