testing/release/common/download_builds.sh

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/testing/release/common/download_builds.sh	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,35 @@
     1.4 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.5 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.7 +
     1.8 +download_builds() {
     1.9 +  # cleanup
    1.10 +  mkdir -p downloads/
    1.11 +  rm -rf downloads/*
    1.12 +
    1.13 +  source_url="$1"
    1.14 +  target_url="$2"
    1.15 +
    1.16 +  if [ -z "$source_url" ] || [ -z "$target_url" ]
    1.17 +  then
    1.18 +    "download_builds usage: <source_url> <target_url>"
    1.19 +    exit 1
    1.20 +  fi
    1.21 +
    1.22 +  for url in "$source_url" "$target_url"
    1.23 +    do
    1.24 +    source_file=`basename "$url"`
    1.25 +    if [ -f "$source_file" ]; then rm "$source_file"; fi
    1.26 +    #PARAMS="--user=user --password=pass"
    1.27 +    cd downloads 
    1.28 +    if [ -f "$source_file" ]; then rm "$source_file"; fi
    1.29 +    wget --no-check-certificate -nv $PARAMS "$url" 2>&1
    1.30 +    if [ $? != 0 ]; then
    1.31 +      echo "FAIL: Could not download source $source_file from $url"
    1.32 +      echo "skipping.."
    1.33 +      cd ../
    1.34 +      continue
    1.35 +    fi
    1.36 +    cd ../
    1.37 +  done
    1.38 +}

mercurial