Update gen-manpages.sh to autodetect hushd version
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
Contents
|
||||
===========
|
||||
# Contrib Devtools
|
||||
|
||||
This directory contains tools for developers working on this repository.
|
||||
|
||||
github-merge.sh
|
||||
|
||||
@@ -1,28 +1,30 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2019 The Hush developers
|
||||
# Released under the GPLv3
|
||||
|
||||
TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)}
|
||||
SRCDIR=${SRCDIR:-$TOPDIR/src}
|
||||
MANDIR=${MANDIR:-$TOPDIR/doc/man}
|
||||
|
||||
KOMODOD=${KOMODOD:-$SRCDIR/komodod}
|
||||
KOMODOCLI=${KOMODOCLI:-$SRCDIR/komodo-cli}
|
||||
KOMODOTX=${KOMODOTX:-$SRCDIR/komodo-tx}
|
||||
HUSHD=${HUSHD:-$SRCDIR/hushd}
|
||||
HUSHCLI=${HUSHCLI:-$SRCDIR/hush-cli}
|
||||
HUSHTX=${HUSHTX:-$SRCDIR/hush-tx}
|
||||
|
||||
[ ! -x $KOMODOD ] && echo "$KOMODOD not found or not executable." && exit 1
|
||||
[ ! -x $HUSHD ] && echo "$HUSHD not found or not executable." && exit 1
|
||||
|
||||
# The autodetected version git tag can screw up manpage output a little bit
|
||||
KMDVER="v3.3.0"
|
||||
#HUSHVER="v3.3.0"
|
||||
HUSHVER=$(./src/hushd --version|head -n2|tail -n1|cut -d' ' -f4|cut -d- -f1)
|
||||
|
||||
# Create a footer file with copyright content.
|
||||
# This gets autodetected fine for komodod if --version-string is not set,
|
||||
# but has different outcomes for komodo-cli.
|
||||
echo "[COPYRIGHT]" > footer.h2m
|
||||
$KOMODOD --version | sed -n '1!p' >> footer.h2m
|
||||
$HUSHD --version | sed -n '1!p' >> footer.h2m
|
||||
|
||||
for cmd in $KOMODOD $KOMODOCLI $KOMODOTX; do
|
||||
for cmd in $HUSHD $HUSHCLI $HUSHTX; do
|
||||
cmdname="${cmd##*/}"
|
||||
help2man -N --version-string=${KMDVER} --include=footer.h2m -o ${MANDIR}/${cmdname}.1 ${cmd}
|
||||
#sed -i "s/\\\-${KMDVER[1]}//g" ${MANDIR}/${cmdname}.1
|
||||
help2man -N --version-string=${HUSHVER} --include=footer.h2m -o ${MANDIR}/${cmdname}.1 ${cmd}
|
||||
#sed -i "s/\\\-${HUSHVER[1]}//g" ${MANDIR}/${cmdname}.1
|
||||
done
|
||||
|
||||
rm -f footer.h2m
|
||||
|
||||
Reference in New Issue
Block a user