blob: e95d3c69a26cb08f810afbf9a76975f2eba095c0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# Backend to convert a DocBook file into a man page
# Send any comments to Jochem Huhmann <joh@revier.com>
# This program is under GPL license. See LICENSE file for details.
# Convert to *roff
HELPER=$SGML_BASE_DIR/docbook/utils-@VERSION@/helpers/docbook2man-spec.pl
TMPDIR=`mktemp -d /tmp/man.XXXXXX` || \
{ echo >&2 "man backend: could not create secure temporary directory"; exit 1;}
trap 'rm -rf "${TMPDIR}"' EXIT
nsgmls $SGML_FILE > "${TMPDIR}/nsgmls.tmp"
sgmlspl $HELPER <"${TMPDIR}/nsgmls.tmp" 2>"${TMPDIR}/errs"
if [ $? -ne 0 ]
then
cat "${TMPDIR}/errs"
exit 1
fi
if grep unresolved "${TMPDIR}/errs" >/dev/null 2>&1
then
echo "Resolving references.."
sgmlspl $HELPER <"${TMPDIR}/nsgmls.tmp"
if [ $? -ne 0 ]
then exit 1
fi
fi
exit 0
|