Redownload the package if size is zero
authorÁngel González <angel@pgp.16bits.net>
Fri, 24 Jun 2016 10:34:07 +0000 (12:34 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Fri, 24 Jun 2016 10:34:07 +0000 (12:34 +0200)
* packages/download.sh: Redownlad on zero size.

--
This can help if a mirror is temporaryily unavailable
and properly show a download error instead of a checksum
error in case download servers are unavailable.

Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
packages/download.sh

index 86ec679..ee7dfdd 100755 (executable)
@@ -155,7 +155,7 @@ while read key value ; do
        if [ -z "$name" ]; then
            name=`basename "$value"`
        fi
-       if [ -f "$name" -a "$force" = "no" ]; then
+       if [ -s "$name" -a "$force" = "no" ]; then
            [ $quiet = no ] && echo "package     \`$url' ... already exists"
        else
            echo -n "downloading \`$url' ..."