]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
- move tmpfile handling outside of lftp
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 23 Oct 2011 10:34:03 +0000 (10:34 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    builder.sh -> 1.658

builder.sh

index 584e482c357e432e5a2cd05fd1e80542ce610ef5..2f759b9f26ba7007d4c0a56116fc9a07f875c8b9 100644 (file)
@@ -192,9 +192,15 @@ elif [ -n "$USE_AXEL" ]; then
        OUTFILEOPT="-o"
 elif [ -n "$USE_LFTP" ]; then
 download_lftp() {
        OUTFILEOPT="-o"
 elif [ -n "$USE_LFTP" ]; then
 download_lftp() {
+       local url outfile retval
        url="$1"
        outfile="$2"
        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
 }
        GETURI=download_lftp
        GETURI2=$GETURI
This page took 0.099042 seconds and 4 git commands to generate.