diff options
author | Paul Sokolovsky <paul.sokolovsky@linaro.org> | 2011-05-25 11:46:35 +0300 |
---|---|---|
committer | Jim Huang <jim.huang@linaro.org> | 2011-05-26 22:09:29 +0800 |
commit | 045bccfdc96282321abda4d00e0d425ec30443de (patch) | |
tree | e8ca7445cc70c46b292f50b68445c3017f5ca4a6 | |
parent | 03a29a045e70cdb7ea575690616f9bb1e6bbd186 (diff) |
Make tarball download logic more robust.
Treat tarball as complete only if it's in the final destination.
Otherwise, just assume that there may be partially downloaded file
in the current directory and wget -c it.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Signed-off-by: Jim Huang <jim.huang@linaro.org>
-rwxr-xr-x | linaro-build.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/linaro-build.sh b/linaro-build.sh index c0982a8..556835e 100755 --- a/linaro-build.sh +++ b/linaro-build.sh @@ -92,11 +92,11 @@ downloadFromHTTP() { local PACKAGE_NAME=`echo $package | tr "[:lower:]" "[:upper:]"` info "Use wget to get $file" - if [ -f "${ARG_TOOLCHAIN_SRC_DIR}/${file}" ] || [ -f "${ARG_TOOLCHAIN_SRC_DIR}/$package/${file}" ]; then + if [ -f "${ARG_TOOLCHAIN_SRC_DIR}/$package/${file}" ]; then #TODO: Add md5 check info "${file} is already exist, skip download" else - wget "$url" || error "wget $1 error" + wget -c "$url" || error "wget $1 error" mv "$file" "${ARG_TOOLCHAIN_SRC_DIR}/$package/" || error "fail to move $file" #TODO: Add md5 check fi |