makepkg: remove empty .part files after a failed download

Signed-off-by: Cedric Staniewski <cedric@gmx.ca>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Cedric Staniewski 2009-10-21 19:13:36 +02:00 committed by Dan McGee
parent 3758ccbb52
commit c6095e1032
1 changed files with 6 additions and 1 deletions

View File

@ -336,7 +336,12 @@ download_file() {
dlcmd="$dlcmd \"$url\""
fi
eval $dlcmd || return $?
local ret=0
eval "$dlcmd || ret=\$?"
if [ $ret -gt 0 ]; then
[ ! -s "$dlfile" ] && rm -f -- "$dlfile"
return $ret
fi
# rename the temporary download file to the final destination
if [ "$dlfile" != "$file" ]; then