scripts/functions: fix downloading with aria2
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Fri Jan 01 17:09:52 2010 +0100 (2010-01-01)
changeset 1673ecb7fcc4edb0
parent 1672 636126117b8c
child 1674 8699778e3888
scripts/functions: fix downloading with aria2

In case the remote file does not exist (and probably for some
other reasons as well), aria2 nonetheless creates an empty file
(or not empty for some other reasons).

The solution is to delete the file whenever aria2 fails.
scripts/functions
     1.1 --- a/scripts/functions	Fri Jan 01 12:27:06 2010 +0100
     1.2 +++ b/scripts/functions	Fri Jan 01 17:09:52 2010 +0100
     1.3 @@ -356,7 +356,7 @@
     1.4      #       so that the CT-NG's ouput is 'live'.
     1.5      CT_DoExecLog ALL aria2c -l - -s ${CT_DOWNLOAD_MAX_CHUNKS} -m 3 -t ${CT_CONNECT_TIMEOUT} -p "$1" \
     1.6      || CT_DoExecLog ALL aria2c -l - -s ${CT_DOWNLOAD_MAX_CHUNKS} -m 3 -t ${CT_CONNECT_TIMEOUT} "$1" \
     1.7 -    || true
     1.8 +    || rm -f "${1##*/}"
     1.9  }
    1.10  
    1.11  # OK, just look if we have them...