]> err.no Git - dak/commitdiff
Make cron.daily shell script more robust.
authorTorsten Werner <twerner@debian.org>
Fri, 1 Apr 2011 05:54:36 +0000 (07:54 +0200)
committerTorsten Werner <twerner@debian.org>
Fri, 1 Apr 2011 05:54:36 +0000 (07:54 +0200)
... and reindent it.

Signed-off-by: Torsten Werner <twerner@debian.org>
config/debian-security/cron.daily

index 213b0a903ee3043ebe978ca0dbad77e9b025c3e7..f33a732cb574c75f69a056fd4c142a29d2def057 100755 (executable)
@@ -14,32 +14,36 @@ rsync --delete -r --include=override\* --exclude=\* --password-file /srv/securit
 
 cd $overridedir
 for file in override*.gz; do
-       zcat $file > $(basename $file .gz)
+    zcat $file > $(basename $file .gz)
 done
 find . -maxdepth 1 -mindepth 1 -type l | xargs --no-run-if-empty rm
 
 for suite in $suites; do
     case $suite in
-               oldstable) override_suite=lenny;;
-               stable) override_suite=squeeze;;
-               testing) override_suite=wheezy;;
-               *) echo "Unknown suite type ($suite)"; exit 1;;
+        oldstable) override_suite=lenny;;
+        stable) override_suite=squeeze;;
+        testing) override_suite=wheezy;;
+        *) echo "Unknown suite type ($suite)"; exit 1;;
     esac
     for component in $components; do
-               for override_type in $override_types; do
-                       case $override_type in
-                               deb) type="" ;;
-                               dsc) type=".src" ;;
-                               udeb) type=".debian-installer" ;;
-                       esac
+        for override_type in $override_types; do
+            case $override_type in
+                deb) type="" ;;
+                dsc) type=".src" ;;
+                udeb) type=".debian-installer" ;;
+            esac
 
-                       if [ "$override_type" = "udeb" ]; then
-                               if [ ! "$component" = "main" ]; then
-                                       continue
-                               fi
-                       fi
-                       zcat override.$override_suite.$component$type.gz | dak control-overrides -q -a -t $override_type -s $suite -c updates/$component
-               done
+            if [ "$override_type" = "udeb" ]; then
+                if [ ! "$component" = "main" ]; then
+                    continue
+                fi
+            fi
+
+            OFILE="override.$override_suite.$component$type.gz"
+            if [ -r "$OFILE" ]; then
+                zcat "$OFILE" | dak control-overrides -q -a -t $override_type -s $suite -c updates/$component
+            fi
+        done
     done
 done
 
@@ -48,13 +52,13 @@ for dist in lenny squeeze wheezy; do
     rm -f override.$dist.all3
     components="main contrib non-free";
     if [ -f override.$dist.main.debian-installer.gz ]; then
-               components="$components main.debian-installer"
+        components="$components main.debian-installer"
     fi
     for component in $components; do
-               zcat override.$dist.$component.gz >> override.$dist.all3
+        zcat override.$dist.$component.gz >> override.$dist.all3
         if [ -e "override.$dist.$component.src.gz" ]; then
-                       zcat override.$dist.$component.src.gz >> override.$dist.all3.src
-               fi
+            zcat override.$dist.$component.src.gz >> override.$dist.all3.src
+        fi
     done
 done