summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 40367aed..78b69047 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -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