Ports: fallback to pro when curl is not installed

This commit is contained in:
Peter Elliott 2021-04-11 12:07:32 -06:00 committed by Andreas Kling
parent f71102a474
commit fbbb4b3395
Notes: sideshowbarker 2024-07-18 20:28:57 +09:00

View File

@ -70,7 +70,7 @@ fetch() {
echo "URL: ${url}"
# FIXME: Serenity's curl port does not support https, even with openssl installed.
if ! curl https://example.com -so /dev/null; then
if which curl && ! curl https://example.com -so /dev/null; then
url=$(echo "$url" | sed "s/^https:\/\//http:\/\//")
fi
@ -79,7 +79,11 @@ fetch() {
if [ -f "$filename" ]; then
echo "$filename already exists"
else
run_nocd curl ${curlopts:-} "$url" -L -o "$filename"
if which curl; then
run_nocd curl ${curlopts:-} "$url" -L -o "$filename"
else
run_nocd pro "$url" > "$filename"
fi
fi
# check md5sum if given