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:
parent
3758ccbb52
commit
c6095e1032
1 changed files with 6 additions and 1 deletions
|
@ -336,7 +336,12 @@ download_file() {
|
||||||
dlcmd="$dlcmd \"$url\""
|
dlcmd="$dlcmd \"$url\""
|
||||||
fi
|
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
|
# rename the temporary download file to the final destination
|
||||||
if [ "$dlfile" != "$file" ]; then
|
if [ "$dlfile" != "$file" ]; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue