From 045bccfdc96282321abda4d00e0d425ec30443de Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 25 May 2011 11:46:35 +0300 Subject: 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 Signed-off-by: Jim Huang --- linaro-build.sh | 4 ++-- 1 file 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 -- cgit v1.2.3