mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:57:34 +00:00
Ports: Do not perform slow curl
check if download already exists
Even if the file was already downloaded, we were trying to perform a relatively slow HTTPS-call.
This commit is contained in:
parent
d7a2b5e65b
commit
7551666a80
1 changed files with 8 additions and 8 deletions
|
@ -299,6 +299,11 @@ do_download_file() {
|
|||
local filename="$2"
|
||||
local accept_existing="${3:-true}"
|
||||
|
||||
if $accept_existing && [ -f "$filename" ]; then
|
||||
echo "$filename already exists"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "Downloading URL: ${url}"
|
||||
|
||||
# FIXME: Serenity's curl port does not support https, even with openssl installed.
|
||||
|
@ -306,15 +311,10 @@ do_download_file() {
|
|||
url=$(echo "$url" | sed "s/^https:\/\//http:\/\//")
|
||||
fi
|
||||
|
||||
# download files
|
||||
if $accept_existing && [ -f "$filename" ]; then
|
||||
echo "$filename already exists"
|
||||
if which curl; then
|
||||
run_nocd curl ${curlopts:-} "$url" -L -o "$filename"
|
||||
else
|
||||
if which curl; then
|
||||
run_nocd curl ${curlopts:-} "$url" -L -o "$filename"
|
||||
else
|
||||
run_nocd pro "$url" > "$filename"
|
||||
fi
|
||||
run_nocd pro "$url" > "$filename"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue