aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorW. J. van der Laan <laanwj@protonmail.com>2021-12-09 14:49:58 +0100
committerW. J. van der Laan <laanwj@protonmail.com>2021-12-09 14:50:58 +0100
commitaab5e48d422d396aec09bd6389de68613b19def5 (patch)
treed594472e07e7cc3c67df9d4917a417fdc49c052e /contrib
parent7629efcc2c3a8a8a7c17b1300cd466ec6c8c1f3f (diff)
parentb062da009001c1beb362169d700663d7220eef5e (diff)
downloadbitcoin-aab5e48d422d396aec09bd6389de68613b19def5.tar.xz
Merge bitcoin/bitcoin#23658: contrib: add check for wget command in install_db4.sh
b062da009001c1beb362169d700663d7220eef5e contrib: add check for wget command in install_db4.sh (Florian Baumgartl) Pull request description: This PR is motivated by https://github.com/bitcoin/bitcoin/commit/7bb8eb0bc352b47ee962283898f9becbb4f36c62 commit (see also https://github.com/bitcoin/bitcoin/pull/23579) and ensures that `install_db4.sh` will check for `curl` and `wget` utilities. Currently, the conditional statement in the `http_get()` function assumes that `wget` is always available but we actually do not know it since there is no check or validation for the `wget` command. So let's make sure that we check for both commands and print an error message if they are missing. ACKs for top commit: jamesob: ACK https://github.com/bitcoin/bitcoin/pull/23658/commits/b062da009001c1beb362169d700663d7220eef5e laanwj: Tested ACK b062da009001c1beb362169d700663d7220eef5e shaavan: ACK b062da009001c1beb362169d700663d7220eef5e Tree-SHA512: bfc1ccad9a5b99764b759e02dde1976616c2af4747b7d5af8e71d33624c2cb21d93a09a60d244756e86bbd5fd7541331c62d7eb84d3458b6a059f1d9cb2a5f42
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/install_db4.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/install_db4.sh b/contrib/install_db4.sh
index 81c88a2ae7..2850c4b993 100755
--- a/contrib/install_db4.sh
+++ b/contrib/install_db4.sh
@@ -55,8 +55,11 @@ http_get() {
echo "File ${2} already exists; not downloading again"
elif check_exists curl; then
curl --insecure --retry 5 "${1}" -o "${2}"
- else
+ elif check_exists wget; then
wget --no-check-certificate "${1}" -O "${2}"
+ else
+ echo "Simple transfer utilities 'curl' and 'wget' not found. Please install one of them and try again."
+ exit 1
fi
sha256_check "${3}" "${2}"
@@ -64,7 +67,7 @@ http_get() {
# Ensure the commands we use exist on the system
if ! check_exists patch; then
- echo "Command-line tool 'patch' not found. Install patch and try again."
+ echo "Command-line tool 'patch' not found. Install patch and try again."
exit 1
fi