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