summaryrefslogtreecommitdiffstats
path: root/abuild.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-04-15 15:52:38 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-04-15 15:52:38 +0000
commita0c0ae76e3a223886154bcd2eb4c0e84853e1c36 (patch)
treec8e5b5ca747b68acc9a6f8ae43355a70510b255e /abuild.in
parente388eb1467c94b0d98acc7d81a2c3e7c99dce67f (diff)
downloadabuild-a0c0ae76e3a223886154bcd2eb4c0e84853e1c36.tar.bz2
abuild-a0c0ae76e3a223886154bcd2eb4c0e84853e1c36.tar.xz
abuild: download from DISTFILES_MIRROR first if set
Diffstat (limited to 'abuild.in')
-rwxr-xr-xabuild.in13
1 files changed, 11 insertions, 2 deletions
diff --git a/abuild.in b/abuild.in
index 7668423..ed58d8a 100755
--- a/abuild.in
+++ b/abuild.in
@@ -149,12 +149,11 @@ md5check() {
uri_fetch() {
local uri="$1"
- local d="${s##*/}" # $(basename $s)
+ local d="${uri##*/}" # $(basename $uri)
local opts
[ -n "$quiet" ] && opts="-q"
[ -f "$SRCDEST/$d" ] && return 0
-
# we need GNU wget for this
case "$uri" in
https://*) opts="--no-check-certificate";;
@@ -178,6 +177,16 @@ is_remote() {
return 1
}
+# try download from file from mirror first
+uri_fetch_mirror() {
+ local uri="$1"
+ local d="${uri##*/}" # $(basename $uri)
+ if [ -n "$DISTFILES_MIRROR" ]; then
+ uri_fetch "$DISTFILES_MIRROR"/$d && return 0
+ fi
+ uri_fetch "$uri"
+}
+
default_fetch() {
local s
mkdir -p "$srcdir"