diff options
author | 2011-03-29 02:11:48 +0000 | |
---|---|---|
committer | 2011-03-29 02:11:48 +0000 | |
commit | 8fc6ffa10e7438cd90034d420990cc902a76a56b (patch) | |
tree | f7b62001cd2e5d3d2bbe2e4b473cd7fa47ffe72e | |
parent | Improve support for local resolver, patch by Jiri Tyr in bug #194485. (diff) | |
download | build-docbook-catalog-8fc6ffa10e7438cd90034d420990cc902a76a56b.tar.gz build-docbook-catalog-8fc6ffa10e7438cd90034d420990cc902a76a56b.tar.bz2 build-docbook-catalog-8fc6ffa10e7438cd90034d420990cc902a76a56b.zip |
Add support for simple-dtds, thanks to Yaakov S in bug #290680.v1.6
Signed-off-by: Diego Pettenò <flameeyes@gentoo.org>
-rwxr-xr-x | build-docbook-catalog | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/build-docbook-catalog b/build-docbook-catalog index 8e575da..10eeba4 100755 --- a/build-docbook-catalog +++ b/build-docbook-catalog @@ -1,5 +1,5 @@ #!/bin/bash -# $Header: /usr/local/src/gentoo/gentoo-src/cvsroot/gentoo-src/build-docbook-catalog/build-docbook-catalog,v 1.5 2009/08/23 16:06:03 flameeyes Exp $ +# $Header: /usr/local/src/gentoo/gentoo-src/cvsroot/gentoo-src/build-docbook-catalog/build-docbook-catalog,v 1.6 2011/03/29 02:11:48 flameeyes Exp $ # # build-docbook-catalog: populate /etc/xml/docbook based in # installed docbook-xml-dtd versions. @@ -41,13 +41,16 @@ main() { # Clean out old dtds from catalog verb "Cleaning out old DocBook XML versions from ${CATALOG} and ${ROOTCATALOG}" - clean_catalog "${DOCBOOKDIR}/xml-dtd-[^/\"']*/[^/\"']*" ${CATALOG} - clean_catalog "${DOCBOOKDIR}/xml-dtd-[^/\"']*/[^/\"']*" ${ROOTCATALOG} + clean_catalog "${DOCBOOKDIR}/xml\(-simple\)*-dtd-[^/\"']*/[^/\"']*" ${CATALOG} + clean_catalog "${DOCBOOKDIR}/xml\(-simple\)*-dtd-[^/\"']*/[^/\"']*" ${ROOTCATALOG} if set_dtds; then for d in ${DTDS}; do populate_dtd ${d} done + for d in ${SIMPLE_DTDS}; do + populate_simple_dtd ${d} + done populate_entities fi @@ -66,6 +69,7 @@ verb() { # set_dtds() { DTDS=$(find ${DOCBOOKDIR} -path '*/xml-dtd-*/docbookx.dtd') + SIMPLE_DTDS=$(find ${DOCBOOKDIR} -path '*/xml-simple-dtd-*/sdocbook.dtd') if [[ -z ${DTDS} ]]; then echo "No installed DocBook XML DTDs found" return 1 @@ -177,6 +181,28 @@ populate_dtd() { fi } +# +# populate a specific simple dtd version into the docbook catalog +# $1 == /path/to/sdocbook.dtd +# +populate_simple_dtd() { + typeset dtd=$1 docbookdir=${1%/*} + typeset v=${docbookdir##*-} + + # sanity check + if [[ ${dtd} != */xml-simple-dtd-*/* ]]; then + echo "Warning: I don't understand \"${dtd}\"" >&2 + return + fi + echo "Found Simplified DocBook XML ${v} in ${docbookdir}" + + # Populate the docbook catalog with this version + verb " Populating ${CATALOG} based on ${docbookdir}" + xmlcatalog --noout --add "public" "-//OASIS//DTD Simplified DocBook XML V${v}//EN" "file://${docbookdir}/sdocbook.dtd" ${CATALOG} + xmlcatalog --noout --add "rewriteSystem" "http://www.oasis-open.org/docbook/xml/simple/${v}" "file://${docbookdir}" ${CATALOG} + xmlcatalog --noout --add "rewriteURI" "http://www.oasis-open.org/docbook/xml/simple/${v}" "file://${docbookdir}" ${CATALOG} +} + # # populate ISO DocBook entities from the most recent DTD # |