download.sh: Add check for zero length downloads.
authorWerner Koch <wk@gnupg.org>
Tue, 17 Apr 2012 16:55:17 +0000 (18:55 +0200)
committerWerner Koch <wk@gnupg.org>
Tue, 17 Apr 2012 16:55:17 +0000 (18:55 +0200)
* packages/packages.current: Add check.

packages/download.sh

index 509d444..685fd67 100755 (executable)
@@ -158,7 +158,12 @@ while read key value ; do
        else
            echo -n "downloading \`$url' ..."
            if ${WGET} -c -q "$url" -O "$name" ; then
-               echo " okay"
+               if [ $(stat -c'%s' "$name" 2>/dev/null || echo 0) -eq 0 ]; then
+                 echo " FAILED (line $lnr)"
+                 echo "line $lnr: $url has zero length" >> '.#download.failed'
+               else
+                 echo " okay"
+               fi
            else
                echo " FAILED (line $lnr)"
                echo "line $lnr: downloading $url failed" >> '.#download.failed'