improve genmanpages to cope with binary packages with no XML

git-svn-id: http://emdebian.org/svn/current@6665 563faec7-e20c-0410-992a-a66f704d0ccd
This commit is contained in:
codehelp 2009-11-01 17:01:14 +00:00
parent 83f3e49f52
commit 9c0cb10f0c
2 changed files with 53 additions and 32 deletions

View file

@ -167,7 +167,7 @@ for d in $BINARIES; do
if [ "$d" = "$HASMAN3" ]; then if [ "$d" = "$HASMAN3" ]; then
mkdir -p $BASEDIR/$d/man/$l/man3/ mkdir -p $BASEDIR/$d/man/$l/man3/
fi fi
mkdir -p $BASEDIR/$d/$l/html/ mkdir -p $BASEDIR/$d/$l/$HTMLDIR/
done done
mkdir -p $BASEDIR/$d/man/man1/ mkdir -p $BASEDIR/$d/man/man1/
if [ "$d" = "$HASMAN3" ]; then if [ "$d" = "$HASMAN3" ]; then
@ -181,10 +181,11 @@ po4a -k 0 $CONFIG
for d in $BINARIES; do for d in $BINARIES; do
for P in $XMLPACKAGES; do for P in $XMLPACKAGES; do
if [ $d = $P ]; then
for X in $XMLFILE; do for X in $XMLFILE; do
echo "Processing untranslated files for $d . . ."
XML_CATALOG_FILES="/etc/xml/catalog" \ XML_CATALOG_FILES="/etc/xml/catalog" \
xsltproc -o $BASEDIR/$P/man/ --nonet $XSLFILE $XMLDIR/$X xsltproc -o $BASEDIR/$P/man/ --nonet $XSLFILE $XMLDIR/$X
done
if [ "$d" = "$HASMAN3" ]; then if [ "$d" = "$HASMAN3" ]; then
mv $BASEDIR/$P/man/*.3 $BASEDIR/$P/man/man3/ mv $BASEDIR/$P/man/*.3 $BASEDIR/$P/man/man3/
else else
@ -192,12 +193,21 @@ for d in $BINARIES; do
fi fi
mv $BASEDIR/$P/man/*.1 $BASEDIR/$P/man/man1/ mv $BASEDIR/$P/man/*.1 $BASEDIR/$P/man/man1/
done done
for POD in $PODPACKAGES; do fi
pod2man $PODFILE > $BASEDIR/$POD/man/man1/$PODFILE.1
done done
xsltproc -o $BASEDIR/$d/html/ --nonet $HTMLXSL $XMLDIR/$HTMLFILE for POD in $PODPACKAGES; do
if [ $d = "$POD" ]; then
echo "Processing untranslated files for $POD . . ."
pod2man $PODFILE > $BASEDIR/$POD/man/man1/$PODFILE.1
fi
done
if [ -n "$HTMLDIR" ]; then
xsltproc -o $BASEDIR/$d/$HTMLDIR/ --nonet $HTMLXSL $XMLDIR/$HTMLFILE
fi
for l in $LANGS; do for l in $LANGS; do
for P in $XMLPACKAGES; do for P in $XMLPACKAGES; do
if [ $d = "$P" ]; then
echo "Processing $l translations for $d . . ."
for X in $XMLFILE; do for X in $XMLFILE; do
XML_CATALOG_FILES="/etc/xml/catalog" \ XML_CATALOG_FILES="/etc/xml/catalog" \
xsltproc -o $BASEDIR/$P/man/ --nonet $XSLFILE $XMLDIR/$l/$X xsltproc -o $BASEDIR/$P/man/ --nonet $XSLFILE $XMLDIR/$l/$X
@ -208,18 +218,29 @@ for d in $BINARIES; do
rm -f $BASEDIR/$P/man/*.3 rm -f $BASEDIR/$P/man/*.3
fi fi
mv $BASEDIR/$P/man/*.1 $BASEDIR/$P/man/$l/man1/ mv $BASEDIR/$P/man/*.1 $BASEDIR/$P/man/$l/man1/
fi
done done
for POD in $PODPACKAGES; do for POD in $PODPACKAGES; do
if [ $d = "$POD" ]; then
echo "Processing $l translations for $POD . . ."
echo "pod2man $BASEDIR/pod/$l/$PODFILE > $BASEDIR/$POD/man/$l/man1/$PODFILE.1"
pod2man $BASEDIR/pod/$l/$PODFILE > $BASEDIR/$POD/man/$l/man1/$PODFILE.1 pod2man $BASEDIR/pod/$l/$PODFILE > $BASEDIR/$POD/man/$l/man1/$PODFILE.1
fi
done done
mkdir -p $BASEDIR/$d/html/$l/ if [ -n "$HTMLDIR" ]; then
xsltproc -o $BASEDIR/$d/html/$l/ --nonet $HTMLXSL $XMLDIR/$l/$HTMLFILE mkdir -p $BASEDIR/$d/$HTMLDIR/$l/
xsltproc -o $BASEDIR/$d/$HTMLDIR/$l/ --nonet $HTMLXSL $XMLDIR/$l/$HTMLFILE
fi
done done
for i in `ls $BASEDIR/$d/html/*.html`; do if [ -n "$HTMLDIR" ]; then
iconv -t utf-8 -f iso8859-1 $i > $BASEDIR/html/tmp for i in `ls $BASEDIR/$d/$HTMLDIR/*.html`; do
sed < $BASEDIR/html/tmp > $i -e 's:charset=ISO-8859-1:charset=UTF-8:' iconv -t utf-8 -f iso8859-1 $i > $BASEDIR/$HTMLDIR/tmp
sed < $BASEDIR/$HTMLDIR/tmp > $i -e 's:charset=ISO-8859-1:charset=UTF-8:'
done done
rm -f $BASEDIR/html/tmp fi
if [ -n "$HTMLDIR" ]; then
rm -f $BASEDIR/$HTMLDIR/tmp
fi
done done
for l in $LANGS; do for l in $LANGS; do

View file

@ -31,8 +31,8 @@ PODFILE="em_multistrap"
# the binary packages using POD # the binary packages using POD
PODPACKAGES="multistrap" PODPACKAGES="multistrap"
# html output (subdirectory of BASEDIR) # html output (subdirectory of BASEDIR)
HTMLDIR="html" HTMLDIR=""
# html DocBook file # html DocBook file
HTMLFILE="emdebian-rootfs.1.xml" HTMLFILE=""
# the XSL file to use for Docbook XSL # the XSL file to use for Docbook XSL
HTMLXSL="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl" HTMLXSL="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"