diff options
author | Hans-Joachim Lankenau <hjs@openoffice.org> | 2010-02-02 18:14:01 +0100 |
---|---|---|
committer | Hans-Joachim Lankenau <hjs@openoffice.org> | 2010-02-02 18:14:01 +0100 |
commit | 783fab170517340b0004f68b3bf22c360ab9df24 (patch) | |
tree | 8a67f2c6d3f6746e4ec647e0cd681ee2c939d342 /fetch_tarballs.sh | |
parent | af8f74871ace8714e7a853d8ed0a2cfd9e239e84 (diff) |
ause110: #i106731# support curl for fetching
Diffstat (limited to 'fetch_tarballs.sh')
-rwxr-xr-x | fetch_tarballs.sh | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/fetch_tarballs.sh b/fetch_tarballs.sh index 7f81749b7753..a99def2e255b 100755 --- a/fetch_tarballs.sh +++ b/fetch_tarballs.sh @@ -53,19 +53,30 @@ fi # check for wget and md5sum wget= md5sum= +curl= -for i in wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget; do +for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget; do eval "$i --version" > /dev/null 2>&1 ret=$? if [ $ret -eq 0 ]; then wget=$i - echo found wget $wget + echo found wget: $wget break 2 fi done -if [ -z "$wget" ]; then - echo "ERROR: no wget found!" +for i in curl /usr/bin/curl /usr/local/bin/curl /usr/sfw/bin/curl /opt/sfw/bin/curl; do + eval "$i --version" > /dev/null 2>&1 + ret=$? + if [ $ret -eq 2 ]; then + curl=$i + echo found curl: $curl + break 2 + fi +done + +if [ -z "$wget" -a -z "$curl" ]; then + echo "ERROR: neither wget nor curl found!" exit fi @@ -92,11 +103,18 @@ for i in `cat $1` ; do else if [ "$tarurl" != "" ]; then cd $TARFILE_LOCATION - $wget -nv -N $tarurl/$i - wret=$? - if [ $wret -ne 0 ]; then - failed="$failed $i" - wret=0 + if [ ! -f $i ]; then + if [ ! -z $wget_ ]; then + $wget -nv -N $tarurl/$i + else + echo fetching $i + $curl $file_date_check -O $tarurl/$i + fi + wret=$? + if [ $wret -ne 0 ]; then + failed="$failed $i" + wret=0 + fi fi if [ -f $i -a -n $md5sum ]; then sum=`$md5sum $i | sed "s/ [ *].*//"` @@ -112,7 +130,11 @@ for i in `cat $1` ; do done if [ ! -z "$failed" ]; then - echo $failed | sed "s/ /\n/g" | sed "s/^/ERROR: failed to download: /" + echo + echo ERROR: failed on: + for i in $failed ; do + echo $i + done exit 1 fi |