scripts: in case of failed download, remove partial files 1.8
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Aug 11 20:07:18 2010 +0200 (2010-08-11)
branch1.8
changeset 209218da1aa1beab
parent 2082 9a030e69fbde
child 2093 7d29f05a7f03
scripts: in case of failed download, remove partial files

It happens from time to time that the server mis-behaves, and breaks the
connection right in the middle of nowhere, for no good reason, leaving us
with a partial file, on which the extract pass would choke.

Remove partial downloads, to fail early.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from eefacabd9e72f3d578e5dc5908026ed780f9a240)
scripts/functions
     1.1 --- a/scripts/functions	Wed Aug 11 20:05:05 2010 +0200
     1.2 +++ b/scripts/functions	Wed Aug 11 20:07:18 2010 +0200
     1.3 @@ -363,7 +363,7 @@
     1.4      # connecting, so force a global ${CT_CONNECT_TIMEOUT}-second timeout.
     1.5      CT_DoExecLog ALL wget -T ${CT_CONNECT_TIMEOUT} -nc --progress=dot:binary --tries=3 --passive-ftp "$1"    \
     1.6      || CT_DoExecLog ALL wget -T ${CT_CONNECT_TIMEOUT} -nc --progress=dot:binary --tries=3 "$1"               \
     1.7 -    || true
     1.8 +    || rm -f "${1##*/}"
     1.9  }
    1.10  
    1.11  # Download an URL using curl
    1.12 @@ -374,7 +374,7 @@
    1.13      #       so, be silent.
    1.14      CT_DoExecLog ALL curl -s --ftp-pasv -O --retry 3 "$1" --connect-timeout ${CT_CONNECT_TIMEOUT} -L -f  \
    1.15      || CT_DoExecLog ALL curl -s -O --retry 3 "$1" --connect-timeout ${CT_CONNECT_TIMEOUT} -L -f          \
    1.16 -    || true
    1.17 +    || rm -f "${1##*/}"
    1.18  }
    1.19  
    1.20  # Download using aria2