michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: download_builds() { michael@0: # cleanup michael@0: mkdir -p downloads/ michael@0: rm -rf downloads/* michael@0: michael@0: source_url="$1" michael@0: target_url="$2" michael@0: michael@0: if [ -z "$source_url" ] || [ -z "$target_url" ] michael@0: then michael@0: "download_builds usage: " michael@0: exit 1 michael@0: fi michael@0: michael@0: for url in "$source_url" "$target_url" michael@0: do michael@0: source_file=`basename "$url"` michael@0: if [ -f "$source_file" ]; then rm "$source_file"; fi michael@0: #PARAMS="--user=user --password=pass" michael@0: cd downloads michael@0: if [ -f "$source_file" ]; then rm "$source_file"; fi michael@0: wget --no-check-certificate -nv $PARAMS "$url" 2>&1 michael@0: if [ $? != 0 ]; then michael@0: echo "FAIL: Could not download source $source_file from $url" michael@0: echo "skipping.." michael@0: cd ../ michael@0: continue michael@0: fi michael@0: cd ../ michael@0: done michael@0: }