|
1 | 1 | #!/bin/sh
|
2 | 2 |
|
3 |
| -# the autodetected version git tag at the end |
4 |
| -# can screw up manpage output a little bit |
5 |
| -BTCVER=$(bitcoin-cli --version | cut -d"-" -f1 | cut -d"v" -f3) |
| 3 | +TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)} |
| 4 | +SRCDIR=${SRCDIR:-$TOPDIR/src} |
| 5 | +MANDIR=${MANDIR:-$TOPDIR/doc/man} |
| 6 | + |
| 7 | +BITCOIND=${BITCOIND:-$SRCDIR/bitcoind} |
| 8 | +BITCOINCLI=${BITCOINCLI:-$SRCDIR/bitcoin-cli} |
| 9 | +BITCOINTX=${BITCOINTX:-$SRCDIR/bitcoin-tx} |
| 10 | +BITCOINQT=${BITCOINQT:-$SRCDIR/qt/bitcoin-qt} |
| 11 | + |
| 12 | +[ ! -x $BITCOIND ] && echo "$BITCOIND not found or not executable." && exit 1 |
| 13 | + |
| 14 | +# The autodetected version git tag can screw up manpage output a little bit |
| 15 | +BTCVER=($($BITCOINCLI --version | head -n1 | awk -F'[ -]' '{ print $6, $7 }')) |
6 | 16 |
|
7 | 17 | # Create a footer file with copyright content.
|
8 |
| -# This gets autodetected fine for bitcoind if |
9 |
| -# --version-string is not set, but has different |
10 |
| -# outcomes for bitcoin-qt and bitcoin-cli. |
| 18 | +# This gets autodetected fine for bitcoind if --version-string is not set, |
| 19 | +# but has different outcomes for bitcoin-qt and bitcoin-cli. |
11 | 20 | echo "[COPYRIGHT]" > footer.h2m
|
12 |
| -bitcoind --version | sed -n '1!p' >> footer.h2m |
| 21 | +$BITCOIND --version | sed -n '1!p' >> footer.h2m |
13 | 22 |
|
14 |
| -for cmd in bitcoind bitcoin-qt bitcoin-cli; do |
15 |
| - help2man -N --version-string=${BTCVER} --include=footer.h2m -o ../../doc/man/${cmd}.1 ${cmd} |
| 23 | +for cmd in $BITCOIND $BITCOINCLI $BITCOINTX $BITCOINQT; do |
| 24 | + cmdname="${cmd##*/}" |
| 25 | + help2man -N --version-string=${BTCVER[0]} --include=footer.h2m -o ${MANDIR}/${cmdname}.1 ${cmd} |
| 26 | + sed -i "s/\\\-${BTCVER[1]}//g" ${MANDIR}/${cmdname}.1 |
16 | 27 | done
|
17 | 28 |
|
18 | 29 | rm -f footer.h2m
|
0 commit comments