[xorg-commit-diffs] xc/config/docbook docbookconv.sh,NONE,1.1.4.1
Roland Mainz
xorg-commit at pdx.freedesktop.org
Wed Apr 21 20:03:18 EST 2004
- Previous message: [xorg-commit-diffs]
xc xf86Date.h, NONE, 1.1.4.1 ChangeLog, 1.1.6.4, 1.1.6.5
- Next message: [xorg-commit-diffs] xc/extras/ttf2pt1 CHANGES.html, NONE,
1.1.4.1 COPYRIGHT, NONE, 1.1.4.1 FONTS.hpux.html, NONE,
1.1.4.1 FONTS.html, NONE, 1.1.4.1 Makefile, NONE,
1.1.4.1 README.FIRST, NONE, 1.1.4.1 README.html, NONE,
1.1.4.1 bdf.c, NONE, 1.1.4.1 bitmap.c, NONE,
1.1.4.1 byteorder.h, NONE, 1.1.4.1 cygbuild.sh, NONE,
1.1.4.1 ft.c, NONE, 1.1.4.1 global.h, NONE, 1.1.4.1 pt1.c,
NONE, 1.1.4.1 pt1.h, NONE, 1.1.4.1 runt1asm.c, NONE,
1.1.4.1 t1asm.c, NONE, 1.1.4.1 ttf.c, NONE, 1.1.4.1 ttf.h,
NONE, 1.1.4.1 ttf2pt1.1, NONE, 1.1.4.1 ttf2pt1.c, NONE,
1.1.4.1 ttf2pt1_convert.1, NONE, 1.1.4.1 ttf2pt1_x2gs.1, NONE,
1.1.4.1 version.h, NONE, 1.1.4.1 winbuild.bat, NONE,
1.1.4.1 windows.h, NONE, 1.1.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: gisburn
Update of /cvs/xorg/xc/config/docbook
In directory pdx:/tmp/cvs-serv5532/config/docbook
Added Files:
Tag: XORG-CURRENT
docbookconv.sh
Log Message:
Fix for http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=530 - Land XPRINT branch on XORG-CURRENT
--- NEW FILE: docbookconv.sh ---
#!/bin/sh
fatal_error()
{
echo "$1" 1>&2
exit 1
}
debug_echo()
{
echo "$1" 1>&2
}
verbose_echo()
{
echo "$1" 1>&2
}
which_tool()
{
echo "${PATH}" | tr ":" "\n" | while read i ;
do ls -1ad "${i}/${1}" 2>/dev/null ; done | sort | uniq
}
which_program()
{
echo "${1}" | tr ":" "\n" | while read i ;
do
which_tool "${i}"
done | sort | uniq
}
which_xsl()
{
ls -1ad ${1}/docbook-xsl-stylesheets*/ 2>/dev/null | head -1
}
# Fix HTML generated by the DocBook XSL stylesheets
# In many cases <nsxyz:p> is used instead of <p>, screwing-up
# display (this stuff only works for XHTML)
fix_docbook_html()
{
sed "s/<ns[0-9]*:p>/<p>/g;s/<\/ns[0-9]*:p>/<\/p>/g"
}
# main
infile="${1}"
outputformat="${2}"
outputfile="${3}"
# xsl processing
case "`uname -s`" in
FreeBSD)
PATH="${PATH}:/usr/local/bin:/usr/local/sbin"
export PATH
stylesheetbase="/usr/local/share/xsl/"
;;
*)
stylesheetbase="/usr/share/sgml/docbook/"
;;
esac
xsltproc="`which_tool xsltproc`"
stylesheetdir="`which_xsl ${stylesheetbase}`"
docbook2man="`which_tool docbook2man`"
verbose_echo "# Using xsltproc=${xsltproc}."
verbose_echo "# Using stylesheetdir=${stylesheetdir}."
verbose_echo "# Using docbook2man=${docbook2man}."
# Prechecks
[ "${infile}" = "" ] && fatal_error "$0: No input file."
[ "${outputfile}" = "" ] && fatal_error "$0: No output file."
[ "${outputformat}" = "" ] && fatal_error "$0: No format given."
[ ! -r "${infile}" ] && fatal_error "$0: Input file not found or readable."
[ ! -x "${xsltproc}" ] && fatal_error "$0: No xsltproc found."
[ ! -r "${stylesheetdir}" ] && fatal_error "$0: No DocBook/XSL style sheets found."
[ ! -x "${docbook2man}" ] && fatal_error "$0: No docbook2man found."
# this is hack style to work around the problem that "docbook2man"
# writes lots of files into the current dir
MYTMPDIR="/tmp/docbookconv_${RANDOM}"
MYCURRDIR="${PWD}"
(
mkdir "${MYTMPDIR}"
cd "${MYTMPDIR}"
case "${outputformat}" in
"html")
cp "${MYCURRDIR}/${infile}" "${infile}.tmp"
if [ "${infile}" != "${infile%.sgml}" ] ; then
verbose_echo "# processing as SGML document"
${xsltproc} --docbook ${stylesheetdir}/html/docbook.xsl "${infile}.tmp" | fix_docbook_html >"${MYCURRDIR}/${outputfile}"
else
verbose_echo "# processing as XML document"
${xsltproc} ${stylesheetdir}/html/docbook.xsl "${infile}.tmp" | fix_docbook_html >"${MYCURRDIR}/${outputfile}"
fi
;;
"man")
cp "${MYCURRDIR}/${infile}" "${infile}.tmp"
${docbook2man} "${infile}.tmp"
manfile="$(ls -1 ${infile%.*}.__*)"
verbose_echo "manfile=${manfile}"
[ ! -r "${manfile}" ] && fatal_error "$0: manfile not found."
cp "${manfile}" "${MYCURRDIR}/${outputfile}"
;;
*)
fatal_error "Unsupported output format ${outputformat}."
;;
esac
)
# EOF.
- Previous message: [xorg-commit-diffs]
xc xf86Date.h, NONE, 1.1.4.1 ChangeLog, 1.1.6.4, 1.1.6.5
- Next message: [xorg-commit-diffs] xc/extras/ttf2pt1 CHANGES.html, NONE,
1.1.4.1 COPYRIGHT, NONE, 1.1.4.1 FONTS.hpux.html, NONE,
1.1.4.1 FONTS.html, NONE, 1.1.4.1 Makefile, NONE,
1.1.4.1 README.FIRST, NONE, 1.1.4.1 README.html, NONE,
1.1.4.1 bdf.c, NONE, 1.1.4.1 bitmap.c, NONE,
1.1.4.1 byteorder.h, NONE, 1.1.4.1 cygbuild.sh, NONE,
1.1.4.1 ft.c, NONE, 1.1.4.1 global.h, NONE, 1.1.4.1 pt1.c,
NONE, 1.1.4.1 pt1.h, NONE, 1.1.4.1 runt1asm.c, NONE,
1.1.4.1 t1asm.c, NONE, 1.1.4.1 ttf.c, NONE, 1.1.4.1 ttf.h,
NONE, 1.1.4.1 ttf2pt1.1, NONE, 1.1.4.1 ttf2pt1.c, NONE,
1.1.4.1 ttf2pt1_convert.1, NONE, 1.1.4.1 ttf2pt1_x2gs.1, NONE,
1.1.4.1 version.h, NONE, 1.1.4.1 winbuild.bat, NONE,
1.1.4.1 windows.h, NONE, 1.1.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the xorg-commit-diffs
mailing list