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.
This commit is contained in:
Yann E. MORIN" 2010-01-01 17:09:52 +01:00
parent b9eba0996a
commit c20e01d094

View File

@ -356,7 +356,7 @@ CT_DoGetFileAria2() {
# so that the CT-NG's ouput is 'live'.
CT_DoExecLog ALL aria2c -l - -s ${CT_DOWNLOAD_MAX_CHUNKS} -m 3 -t ${CT_CONNECT_TIMEOUT} -p "$1" \
|| CT_DoExecLog ALL aria2c -l - -s ${CT_DOWNLOAD_MAX_CHUNKS} -m 3 -t ${CT_CONNECT_TIMEOUT} "$1" \
|| true
|| rm -f "${1##*/}"
}
# OK, just look if we have them...