aboutsummaryrefslogtreecommitdiff
path: root/contrib/devtools
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2020-12-07 10:15:32 +0100
committerWladimir J. van der Laan <laanwj@protonmail.com>2020-12-07 10:51:45 +0100
commitf3e17686b37a70860bd4636f54c77da6fef59240 (patch)
tree3c35ee16f6f46fdab60514427cfe447812233555 /contrib/devtools
parent31438cc8184f9806ef41068c9a7d6ae5ecc0fc7e (diff)
parent6690adba08006739da0060eb4937126bdfa1181a (diff)
downloadbitcoin-f3e17686b37a70860bd4636f54c77da6fef59240.tar.xz
Merge #20468: build: warn when generating man pages for binaries built from a dirty branch
6690adba08006739da0060eb4937126bdfa1181a Warn when binaries are built from a dirty branch. (Tyler Chambers) Pull request description: - Adjusted `--version` flag behavior in bitcoind and bitcoin-wallet to have the same behavior. - Added `--version` flag to bitcoin-tx to match. - Added functionality in gen-manpages.sh to error when attempting to generate man pages for binaries built from a dirty branch. mitigates problem with issue #20412 ACKs for top commit: laanwj: Tested ACK 6690adba08006739da0060eb4937126bdfa1181a Tree-SHA512: b5ca509f1a57f66808c2bebc4b710ca00c6fec7b5ebd7eef58018e28e716f5f2358e36551b8a4df571bf3204baed565a297aeefb93990e7a99add502b97ee1b8
Diffstat (limited to 'contrib/devtools')
-rwxr-xr-xcontrib/devtools/gen-manpages.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/contrib/devtools/gen-manpages.sh b/contrib/devtools/gen-manpages.sh
index aa65953d83..3fdcda4fd4 100755
--- a/contrib/devtools/gen-manpages.sh
+++ b/contrib/devtools/gen-manpages.sh
@@ -18,6 +18,22 @@ BITCOINQT=${BITCOINQT:-$BINDIR/qt/bitcoin-qt}
[ ! -x $BITCOIND ] && echo "$BITCOIND not found or not executable." && exit 1
+# Don't allow man pages to be generated for binaries built from a dirty tree
+DIRTY=""
+for cmd in $BITCOIND $BITCOINCLI $BITCOINTX $WALLET_TOOL $BITCOINQT; do
+ VERSION_OUTPUT=$($cmd --version)
+ if [[ $VERSION_OUTPUT == *"dirty"* ]]; then
+ DIRTY="${DIRTY}${cmd}\n"
+ fi
+done
+if [ -n "$DIRTY" ]
+then
+ echo -e "WARNING: the following binaries were built from a dirty tree:\n"
+ echo -e $DIRTY
+ echo "man pages generated from dirty binaries should NOT be committed."
+ echo "To properly generate man pages, please commit your changes to the above binaries, rebuild them, then run this script again."
+fi
+
# The autodetected version git tag can screw up manpage output a little bit
read -r -a BTCVER <<< "$($BITCOINCLI --version | head -n1 | awk -F'[ -]' '{ print $6, $7 }')"