From e45104d1c2e38e411a56a8083339eabc60bb3f44 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Thu, 13 Sep 2012 23:53:04 +0400 Subject: Initial commit: can build c-ares --- scripts/download-archive | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 scripts/download-archive (limited to 'scripts/download-archive') diff --git a/scripts/download-archive b/scripts/download-archive new file mode 100755 index 0000000..e8cce16 --- /dev/null +++ b/scripts/download-archive @@ -0,0 +1,25 @@ +#!/bin/sh + +set -e +set -u + +fatal () { + echo "$@" >&2 + exit 1 +} + +archive="$1" +url="$2" +shift 2 + +wget=`type -p wget || true` +curl=`type -p curl || true` + +if [ -n "$wget" ]; then + $wget -c -O "$archive" "$url" || rm -f "$archive" +elif [ -n "$curl" ]; then + $curl "$url" > "$archive" || rm -f "$archive" +else + fatal "Don't know howto download" +fi + -- cgit v1.2.3