summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2011-09-21 11:54:51 +0100
committerNeil Roberts <neil@linux.intel.com>2011-10-17 14:18:07 +0100
commitee899d6fbd5f5e0bdd113342c87231ead56a277d (patch)
treebb5182efc9ad9243464e5409bc26209406332de4
parentfe5760bd1ad85731a3b4512fb8da1ac68d48deed (diff)
downloadcogl-ee899d6fbd5f5e0bdd113342c87231ead56a277d.tar.gz
mingw-fetch-dependencies.sh: Don't pass -c to wget
The -c option for wget and -C - option to curl are used to make it continue the download if the file already exists. The idea was that it wouldn't waste time downloading the files again if the file already exists. However this causes problems if the remote file gets larger because the download will continue from the size of the old file so it will get corrupt. Instead let's just explicitly check if the file already exists and avoid calling wget or curl altogether. Reviewed-by: Robert Bragg <robert@linux.intel.com> (cherry picked from commit c2721664aac000588e0a20b0bb1f8e896b18eddc)
-rwxr-xr-xbuild/mingw/mingw-fetch-dependencies.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/build/mingw/mingw-fetch-dependencies.sh b/build/mingw/mingw-fetch-dependencies.sh
index f4083489..54028b3d 100755
--- a/build/mingw/mingw-fetch-dependencies.sh
+++ b/build/mingw/mingw-fetch-dependencies.sh
@@ -33,12 +33,17 @@ function download_file ()
local url="$1"; shift;
local filename="$1"; shift;
+ if test -f "$DOWNLOAD_DIR/$filename"; then
+ echo "Skipping download of $filename because the file already exists";
+ return 0;
+ fi;
+
case "$DOWNLOAD_PROG" in
curl)
- curl -C - -o "$DOWNLOAD_DIR/$filename" "$url";
+ curl -o "$DOWNLOAD_DIR/$filename" "$url";
;;
*)
- $DOWNLOAD_PROG -O "$DOWNLOAD_DIR/$filename" -c "$url";
+ $DOWNLOAD_PROG -O "$DOWNLOAD_DIR/$filename" "$url";
;;
esac;