Skip to content

Commit aab5e48

Browse files
committed
Merge bitcoin/bitcoin#23658: contrib: add check for wget command in install_db4.sh
b062da0 contrib: add check for wget command in install_db4.sh (Florian Baumgartl) Pull request description: This PR is motivated by bitcoin/bitcoin@7bb8eb0 commit (see also bitcoin/bitcoin#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 bitcoin/bitcoin@b062da0 laanwj: Tested ACK b062da0 shaavan: ACK b062da0 Tree-SHA512: bfc1ccad9a5b99764b759e02dde1976616c2af4747b7d5af8e71d33624c2cb21d93a09a60d244756e86bbd5fd7541331c62d7eb84d3458b6a059f1d9cb2a5f42
2 parents 7629efc + b062da0 commit aab5e48

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

contrib/install_db4.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,19 @@ http_get() {
5555
echo "File ${2} already exists; not downloading again"
5656
elif check_exists curl; then
5757
curl --insecure --retry 5 "${1}" -o "${2}"
58-
else
58+
elif check_exists wget; then
5959
wget --no-check-certificate "${1}" -O "${2}"
60+
else
61+
echo "Simple transfer utilities 'curl' and 'wget' not found. Please install one of them and try again."
62+
exit 1
6063
fi
6164

6265
sha256_check "${3}" "${2}"
6366
}
6467

6568
# Ensure the commands we use exist on the system
6669
if ! check_exists patch; then
67-
echo "Command-line tool 'patch' not found. Install patch and try again."
70+
echo "Command-line tool 'patch' not found. Install patch and try again."
6871
exit 1
6972
fi
7073

0 commit comments

Comments
 (0)