From c6095e103240589895ebdd4b3789c960cb897ed5 Mon Sep 17 00:00:00 2001 From: Cedric Staniewski Date: Wed, 21 Oct 2009 19:13:36 +0200 Subject: makepkg: remove empty .part files after a failed download Signed-off-by: Cedric Staniewski Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts') 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 -- cgit v1.2.3