Skip to content

Commit 14fe4db

Browse files
committed
Merge bitcoin/bitcoin#23579: script install_db4.sh check for patch command before continuing to install db4
7bb8eb0 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 7bb8eb0 Tree-SHA512: f0c59ec509dff6637c41eec2923fe708456c3a7ae04495b12c5492681a1f95d1d9a643a2649df13ba8e6ac708680c627657b6989b62eff63be021e92e1d7c4a8
2 parents cf24152 + 7bb8eb0 commit 14fe4db

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

contrib/install_db4.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
# Copyright (c) 2017-2019 The Bitcoin Core developers
2+
# Copyright (c) 2017-2021 The Bitcoin Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

@@ -62,6 +62,12 @@ http_get() {
6262
sha256_check "${3}" "${2}"
6363
}
6464

65+
# Ensure the commands we use exist on the system
66+
if ! check_exists patch; then
67+
echo "Command-line tool 'patch' not found. Install patch and try again."
68+
exit 1
69+
fi
70+
6571
mkdir -p "${BDB_PREFIX}"
6672
http_get "${BDB_URL}" "${BDB_VERSION}.tar.gz" "${BDB_HASH}"
6773
tar -xzvf ${BDB_VERSION}.tar.gz -C "$BDB_PREFIX"

0 commit comments

Comments
 (0)