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

[buster-queue] [PATCH] apt.systemd.daily: more checks for 'always' before numerical values



Prevents more crashes when the configuration actually uses 'always':

apt.systemd.daily: 409: [: Illegal number: 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 51f2d11d8..d1d1a5220 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
 
@@ -389,12 +391,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.11.0


Reply to: