summaryrefslogtreecommitdiffstats
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
authorCedric Staniewski <cedric@gmx.ca>2009-10-21 19:13:36 +0200
committerDan McGee <dan@archlinux.org>2009-10-24 16:54:57 +0200
commitc6095e103240589895ebdd4b3789c960cb897ed5 (patch)
tree34a53be3317af5ed91d62e7c697efa189a85a5cf /scripts/makepkg.sh.in
parent3758ccbb524b502cc6162324f1b953215b6b970e (diff)
downloadpacman-c6095e103240589895ebdd4b3789c960cb897ed5.tar.gz
pacman-c6095e103240589895ebdd4b3789c960cb897ed5.tar.xz
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>
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