aboutsummaryrefslogtreecommitdiff
path: root/libs/common
diff options
context:
space:
mode:
authorAndrew Robbins <contact@andrewrobbins.info>2017-09-20 11:01:28 -0400
committerAndrew Robbins <contact@andrewrobbins.info>2017-09-20 11:01:28 -0400
commitcd96d96c6f43f971c688620f7f8dee2d262c81a5 (patch)
treeb631a765ea14779e84f46eceb3bc9a40ba6fbe60 /libs/common
parentc3b7abbbbcb2b1fa4fa2698e77e9457b7af638a7 (diff)
downloadlibrebootfr-cd96d96c6f43f971c688620f7f8dee2d262c81a5.tar.gz
librebootfr-cd96d96c6f43f971c688620f7f8dee2d262c81a5.zip
Conditionally use wget or curl in download_wrapper
Diffstat (limited to 'libs/common')
-rwxr-xr-xlibs/common16
1 files changed, 15 insertions, 1 deletions
diff --git a/libs/common b/libs/common
index 8dff9d18..db72a974 100755
--- a/libs/common
+++ b/libs/common
@@ -91,7 +91,21 @@ download_wrapper() {
'--'
)
- wget "${wget_options[@]}" "${uris[@]}"
+ if hash wget > /dev/null 2>&1; then
+
+ wget "${wget_options[@]}" "${uris[@]}"
+
+ elif hash curl > /dev/null 2>&1; then
+ (
+ cd "$download_dir"
+
+ curl "${curl_options[@]}" "${uris[@]}"
+ )
+ else
+ printf '\n%s\n\n' 'Error: Neither wget nor curl were found' 1>&2
+
+ return 1
+ fi
}
diff_patch_file() {