[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] Fix some more crashes when APT::Periodic options are set to always



---
 debian/apt.systemd.daily | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/debian/apt.systemd.daily b/debian/apt.systemd.daily
index 5f868e868..40b6692ec 100755
--- a/debian/apt.systemd.daily
+++ b/debian/apt.systemd.daily
@@ -235,7 +235,9 @@ check_size_constraints()
 do_cache_backup()
 {
     BackupArchiveInterval="$1"
-    if [ $BackupArchiveInterval -eq 0 ]; then
+    if [ $BackupArchiveInterval = always ]; then
+        :
+    elif [ $BackupArchiveInterval -eq 0 ]; then
 	return
     fi
 
@@ -406,12 +408,19 @@ Debdelta=1
 eval $(apt-config shell Debdelta APT::Periodic::Download-Upgradeable-Packages-Debdelta)
 
 # check if we actually have to do anything that requires locking the cache
-if [ $UpdateInterval -eq 0 ] &&
-   [ $DownloadUpgradeableInterval -eq 0 ] &&
-   [ $UnattendedUpgradeInterval -eq 0 ] &&
-   [ $BackupArchiveInterval -eq 0 ] &&
-   [ $AutocleanInterval -eq 0 ] &&
-   [ $CleanInterval -eq 0 ]; then
+if [ $UpdateInterval = always ] ||
+   [ $DownloadUpgradeableInterval = always ] ||
+   [ $UnattendedUpgradeInterval = always ] ||
+   [ $BackupArchiveInterval = always ] ||
+   [ $AutocleanInterval = always ] ||
+   [ $CleanInterval = always ] ; then
+    :
+elif [ $UpdateInterval -eq 0 ] &&
+     [ $DownloadUpgradeableInterval -eq 0 ] &&
+     [ $UnattendedUpgradeInterval -eq 0 ] &&
+     [ $BackupArchiveInterval -eq 0 ] &&
+     [ $AutocleanInterval -eq 0 ] &&
+     [ $CleanInterval -eq 0 ] ; then
 
     # check cache size
     check_size_constraints
-- 
2.13.2


Reply to: