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

View file

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