mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 10:04:32 +03:00
2a2ea71db3
By default exit after the first error in jade.
62 lines
1.7 KiB
Bash
Executable File
62 lines
1.7 KiB
Bash
Executable File
#! /bin/sh
|
|
|
|
# Forget portability - this is a script for maintainers only.
|
|
# In fact, it's only known to run on RedHat Linux 7.1.
|
|
# HTML files are included with the distribution, so it's not a big deal.
|
|
|
|
# Adjustable parts.
|
|
: ${DSL=/usr/share/sgml/docbook/utils-0.6/docbook-utils.dsl}
|
|
: ${JADE=jade}
|
|
: ${JADEFLAGS=-E 1}
|
|
|
|
# Exit on errors.
|
|
set -e
|
|
|
|
# Big fat warning in case we need it.
|
|
WARNING='
|
|
|
|
Could not generate GMC documentation.
|
|
Due to installations of DocBook being very different across platforms
|
|
and distributions, this "mkhtml" script has been designed to run on
|
|
RedHat Linux 7.1 only. You may want to adapt it to your system if you
|
|
have DocBook 4.1 installed.
|
|
|
|
Please DO NOT make official releases of GNU Midnight Commander on the
|
|
systems where the GMC documentation fails to be generated.
|
|
|
|
'
|
|
|
|
# What to remove in case of failure
|
|
CLEANFILES="*.html genindex.sgml HTML.index"
|
|
rm -f $CLEANFILES
|
|
|
|
# Trap if something goes wrong
|
|
for signal in 0 1 2 13 15; do
|
|
trap 'status=$?
|
|
set +e
|
|
trap 0
|
|
test $status = 0 || { echo "$WARNING"; rm -f $CLEANFILES; }
|
|
exit $status' $signal
|
|
done
|
|
|
|
# Make sure $DSL exists. TODO: search in all known locations here.
|
|
test -f "$DSL" || { echo "$DSL not found"; exit 1; }
|
|
|
|
# Complicated bootstrap process - create empty genindex.sgml first,
|
|
# then generate it and then generate html files again.
|
|
echo >genindex.sgml
|
|
|
|
# First pass
|
|
echo "First pass"
|
|
$JADE $JADEFLAGS -t sgml -i html -d "$DSL#html" -V html-index=1 gmc.sgml
|
|
|
|
# collateindex.pl may not have /usr/bin/perl on the first line.
|
|
echo "Generating index"
|
|
perl /usr/bin/collateindex.pl HTML.index >genindex.sgml
|
|
rm -f HTML.index
|
|
|
|
# Second pass with the right genindex.sgml
|
|
echo "Second pass"
|
|
$JADE $JADEFLAGS -t sgml -i html -d "$DSL#html" gmc.sgml
|
|
|