diff options
author | Cedric Staniewski <cedric@gmx.ca> | 2009-10-21 19:13:36 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2009-10-24 16:54:57 +0200 |
commit | c6095e103240589895ebdd4b3789c960cb897ed5 (patch) | |
tree | 34a53be3317af5ed91d62e7c697efa189a85a5cf /scripts | |
parent | 3758ccbb524b502cc6162324f1b953215b6b970e (diff) | |
download | pacman-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')
-rw-r--r-- | scripts/makepkg.sh.in | 7 |
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 |