From: Torsten Werner Date: Fri, 1 Apr 2011 05:54:36 +0000 (+0200) Subject: Make cron.daily shell script more robust. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e097190699f8ed57a4c3045f7fc0d93ee5ff106e;p=dak Make cron.daily shell script more robust. ... and reindent it. Signed-off-by: Torsten Werner --- diff --git a/config/debian-security/cron.daily b/config/debian-security/cron.daily index 213b0a90..f33a732c 100755 --- a/config/debian-security/cron.daily +++ b/config/debian-security/cron.daily @@ -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