-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
buildsys: teach package boostrap to use curl if available
This allows people to do a package bootstrap on macOS without installing wget, as curl is installed there by default but wget is not.
- Loading branch information
Showing
3 changed files
with
22 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#/bin/sh | ||
# | ||
# This script expects a single argument, which should be an URL pointing to a | ||
# file for download; it then tries to download that file, into a local file | ||
# with the same name as the remote file. | ||
set -e | ||
|
||
# check whether curl is available, and if so, delegate to it | ||
command -v curl >/dev/null 2>&1 && exec curl -O "$@" | ||
|
||
# check whether wget is available, and if so, delegate to it | ||
command -v wget >/dev/null 2>&1 && exec wget -N "$@" | ||
|
||
# if no supported download tool is available, abort | ||
echo "Error, failed to download: neither wget nor curl available" | ||
exit 1 |