--- a/lib/Tools/components Fri Nov 30 15:02:31 2018 +0100
+++ b/lib/Tools/components Fri Nov 30 16:09:45 2018 +0100
@@ -127,11 +127,13 @@
type -p curl > /dev/null || fail "Cannot download files: missing curl"
echo "Getting \"$REMOTE\""
mkdir -p "$(dirname "$FULL_NAME")"
- curl --fail --silent "$REMOTE" > "${FULL_NAME}.tar.gz" || \
+ curl --fail --silent "$REMOTE" > "${FULL_NAME}.tar.gz.part" || \
fail "Failed to download \"$REMOTE\""
- if perl -e "exit((stat('${FULL_NAME}.tar.gz'))[7] == 0 ? 0 : 1);"
+ if perl -e "exit((stat('${FULL_NAME}.tar.gz.part'))[7] == 0 ? 0 : 1);"
then
- rm -f "${FULL_NAME}.tar.gz"
+ rm -f "${FULL_NAME}.tar.gz.part"
+ else
+ mv "${FULL_NAME}.tar.gz.part" "${FULL_NAME}.tar.gz"
fi
fi
if [ -e "${FULL_NAME}.tar.gz" ]; then