mkpackage: forced CURL to return error if download fails, remove file if download fails.

This commit is contained in:
Ricardo Martins 2016-02-11 14:15:14 +00:00 committed by José Braga
parent fe76470a31
commit febcfa0425
1 changed files with 3 additions and 1 deletions

View File

@ -28,11 +28,13 @@ download_tool()
{
wget -c "$1" -O "$2"
if [ $? -eq 0 ]; then
rm -f "$2"
return 0
fi
curl -C - "$1" -o "$2"
curl -f -C - "$1" -o "$2"
if [ $? -eq 0 ]; then
rm -f "$2"
return 0
fi