diff options
author | W. J. van der Laan <laanwj@protonmail.com> | 2021-11-25 21:11:13 +0100 |
---|---|---|
committer | W. J. van der Laan <laanwj@protonmail.com> | 2021-11-25 21:28:28 +0100 |
commit | 14fe4dbd4c897ccd79fe70c33f75661bbc66ab66 (patch) | |
tree | 50cd29fc948a5257411603c98cb6dcb886adf0d4 /contrib | |
parent | cf2415259698e1b9d81d08e7b4ace10befdca2a9 (diff) | |
parent | 7bb8eb0bc352b47ee962283898f9becbb4f36c62 (diff) | |
download | bitcoin-14fe4dbd4c897ccd79fe70c33f75661bbc66ab66.tar.xz |
Merge bitcoin/bitcoin#23579: script install_db4.sh check for `patch` command before continuing to install db4
7bb8eb0bc352b47ee962283898f9becbb4f36c62 script install_db4.sh added check for patch command (Nathan Garabedian)
Pull request description:
First contribution. I've read the CONTRIBUTING guide and hope I'm doing this correctly, but please kindly point out anything I should do differently.
I found while running the contrib/install_db4.sh patch that it would fail suddenly with "patch: command not found". I'd rather see it fail early before doing any work, allow me to install the `patch` command, and then run again. (CentOS Linux) Here's a PR proposed to fix it.
error message:
```
...
db-4.8.30.NC/txn/txn_rec.c
db-4.8.30.NC/txn/txn_region.c
db-4.8.30.NC/txn/txn_stat.c
db-4.8.30.NC/txn/txn_util.c
./contrib/install_db4.sh: line 71: patch: command not found
```
ACKs for top commit:
laanwj:
Code review and tested ACK 7bb8eb0bc352b47ee962283898f9becbb4f36c62
Tree-SHA512: f0c59ec509dff6637c41eec2923fe708456c3a7ae04495b12c5492681a1f95d1d9a643a2649df13ba8e6ac708680c627657b6989b62eff63be021e92e1d7c4a8
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/install_db4.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/install_db4.sh b/contrib/install_db4.sh index 36a4ea08f6..81c88a2ae7 100755 --- a/contrib/install_db4.sh +++ b/contrib/install_db4.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2017-2019 The Bitcoin Core developers +# Copyright (c) 2017-2021 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -62,6 +62,12 @@ http_get() { sha256_check "${3}" "${2}" } +# 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." + exit 1 +fi + mkdir -p "${BDB_PREFIX}" http_get "${BDB_URL}" "${BDB_VERSION}.tar.gz" "${BDB_HASH}" tar -xzvf ${BDB_VERSION}.tar.gz -C "$BDB_PREFIX" |