diff options
author | Tyler Chambers <tyler@iHeartAPIs.com> | 2020-11-28 18:43:55 -0500 |
---|---|---|
committer | Tyler Chambers <tyler@iHeartAPIs.com> | 2020-11-28 18:43:55 -0500 |
commit | 6690adba08006739da0060eb4937126bdfa1181a (patch) | |
tree | dbca7183724e614b677825b73311e55df01079cc /contrib/devtools | |
parent | 555b5d1bf940646a728499cfa1005bcb61383c20 (diff) |
Warn when binaries are built from a dirty branch.
Adjusted version flag behavior in bitcoin-tx, bitcoin-wallet, and
bitcoind to match. Added functionality in gen-manpages.sh to warning when
attempting to generate man pages for binaries built from a dirty
branch.
Diffstat (limited to 'contrib/devtools')
-rwxr-xr-x | contrib/devtools/gen-manpages.sh | 16 |
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 }')" |