From 2830c943ce5e64b68caa36d670ef3906b6c0687d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Sun, 23 Oct 2011 10:34:03 +0000 Subject: [PATCH] - move tmpfile handling outside of lftp Changed files: builder.sh -> 1.658 --- builder.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/builder.sh b/builder.sh index 584e482..2f759b9 100644 --- a/builder.sh +++ b/builder.sh @@ -192,9 +192,15 @@ elif [ -n "$USE_AXEL" ]; then OUTFILEOPT="-o" elif [ -n "$USE_LFTP" ]; then download_lftp() { + local url outfile retval url="$1" outfile="$2" - lftp -c "set net:max-retries $WGET_RETRIES; set http:user-agent \"$USER_AGENT\"; pget -n 10 -c \"$url\" -o \"$outfile.tmp\" && local mv \"$outfile.tmp\" \"$outfile\" || local rm -f \"$outfile.tmp\"" + lftp -c "set net:max-retries $WGET_RETRIES; set http:user-agent \"$USER_AGENT\"; pget -n 10 -c \"$url\" -o \"$outfile.tmp\"" + if [ $? -eq 0 ]; then + mv -f "$outfile.tmp" "$outfile" + else + rm -f "$outfile.tmp" + fi } GETURI=download_lftp GETURI2=$GETURI -- 2.43.0