abuild: make curl follow redirects
This commit is contained in:
parent
df05d495b0
commit
c98b47b7ad
@ -239,8 +239,9 @@ sourcecheck() {
|
|||||||
# convert curl options to wget options and call wget instead of curl
|
# convert curl options to wget options and call wget instead of curl
|
||||||
wget_fallback() {
|
wget_fallback() {
|
||||||
local wget_opts= outfile= opt=
|
local wget_opts= outfile= opt=
|
||||||
while getopts "C:ko:s" opt; do
|
while getopts "C:Lko:s" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
|
'L') ;; # --location. wget does this by default
|
||||||
'C') wget_opts="$wget_opts -c";; # --continue-at
|
'C') wget_opts="$wget_opts -c";; # --continue-at
|
||||||
's') wget_opts="$wget_opts -q";; # --silent
|
's') wget_opts="$wget_opts -q";; # --silent
|
||||||
'o') wget_opts="$wget_opts -O $OPTARG";; # --output
|
'o') wget_opts="$wget_opts -O $OPTARG";; # --output
|
||||||
@ -277,9 +278,12 @@ uri_fetch() {
|
|||||||
msg "Fetching $uri"
|
msg "Fetching $uri"
|
||||||
|
|
||||||
# fallback to wget if curl is missing. useful for bootstrapping
|
# fallback to wget if curl is missing. useful for bootstrapping
|
||||||
local fetcher=curl
|
local fetcher=
|
||||||
if ! [ -x "$(which curl)" ]; then
|
if ! [ -x "$(which curl)" ]; then
|
||||||
fetcher=wget_fallback
|
fetcher=wget_fallback
|
||||||
|
else
|
||||||
|
fetcher=curl
|
||||||
|
opts="$opts -L"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$fetcher $opts -o "$SRCDEST/$d.part" "$uri" \
|
$fetcher $opts -o "$SRCDEST/$d.part" "$uri" \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user