summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-12-16 17:02:16 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2011-12-16 17:02:16 +0100
commitc98b47b7ada5d79981f43311b6954988aa7525e5 (patch)
treeccbe03cd92f217ca86abf4f5e8f53408853d8c4d
parentdf05d495b0d3caaac2570d5a955c988f85d90ca9 (diff)
downloadabuild-c98b47b7ada5d79981f43311b6954988aa7525e5.tar.gz
abuild-c98b47b7ada5d79981f43311b6954988aa7525e5.tar.bz2
abuild-c98b47b7ada5d79981f43311b6954988aa7525e5.tar.xz
abuild-c98b47b7ada5d79981f43311b6954988aa7525e5.zip
abuild: make curl follow redirects
-rwxr-xr-xabuild.in8
1 files changed, 6 insertions, 2 deletions
diff --git a/abuild.in b/abuild.in
index 7b1af38..3898960 100755
--- a/abuild.in
+++ b/abuild.in
@@ -239,8 +239,9 @@ sourcecheck() {
# convert curl options to wget options and call wget instead of curl
wget_fallback() {
local wget_opts= outfile= opt=
- while getopts "C:ko:s" opt; do
+ while getopts "C:Lko:s" opt; do
case $opt in
+ 'L') ;; # --location. wget does this by default
'C') wget_opts="$wget_opts -c";; # --continue-at
's') wget_opts="$wget_opts -q";; # --silent
'o') wget_opts="$wget_opts -O $OPTARG";; # --output
@@ -277,9 +278,12 @@ uri_fetch() {
msg "Fetching $uri"
# fallback to wget if curl is missing. useful for bootstrapping
- local fetcher=curl
+ local fetcher=
if ! [ -x "$(which curl)" ]; then
fetcher=wget_fallback
+ else
+ fetcher=curl
+ opts="$opts -L"
fi
$fetcher $opts -o "$SRCDEST/$d.part" "$uri" \