Gentoo Archives: gentoo-commits

From: "Diego Petteno (flameeyes)" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-src commit in build-docbook-catalog: build-docbook-catalog
Date: Tue, 29 Mar 2011 02:11:59
Message-Id: 20110329021148.E37ED20057@flycatcher.gentoo.org
1 flameeyes 11/03/29 02:11:48
2
3 Modified: build-docbook-catalog
4 Log:
5 Add support for simple-dtds, thanks to Yaakov S in bug #290680.
6
7 Revision Changes Path
8 1.6 build-docbook-catalog/build-docbook-catalog
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-src/build-docbook-catalog/build-docbook-catalog?rev=1.6&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-src/build-docbook-catalog/build-docbook-catalog?rev=1.6&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-src/build-docbook-catalog/build-docbook-catalog?r1=1.5&r2=1.6
13
14 Index: build-docbook-catalog
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-src/build-docbook-catalog/build-docbook-catalog,v
17 retrieving revision 1.5
18 retrieving revision 1.6
19 diff -u -r1.5 -r1.6
20 --- build-docbook-catalog 23 Aug 2009 16:06:03 -0000 1.5
21 +++ build-docbook-catalog 29 Mar 2011 02:11:48 -0000 1.6
22 @@ -1,5 +1,5 @@
23 #!/bin/bash
24 -# $Header: /var/cvsroot/gentoo-src/build-docbook-catalog/build-docbook-catalog,v 1.5 2009/08/23 16:06:03 flameeyes Exp $
25 +# $Header: /var/cvsroot/gentoo-src/build-docbook-catalog/build-docbook-catalog,v 1.6 2011/03/29 02:11:48 flameeyes Exp $
26 #
27 # build-docbook-catalog: populate /etc/xml/docbook based in
28 # installed docbook-xml-dtd versions.
29 @@ -41,13 +41,16 @@
30
31 # Clean out old dtds from catalog
32 verb "Cleaning out old DocBook XML versions from ${CATALOG} and ${ROOTCATALOG}"
33 - clean_catalog "${DOCBOOKDIR}/xml-dtd-[^/\"']*/[^/\"']*" ${CATALOG}
34 - clean_catalog "${DOCBOOKDIR}/xml-dtd-[^/\"']*/[^/\"']*" ${ROOTCATALOG}
35 + clean_catalog "${DOCBOOKDIR}/xml\(-simple\)*-dtd-[^/\"']*/[^/\"']*" ${CATALOG}
36 + clean_catalog "${DOCBOOKDIR}/xml\(-simple\)*-dtd-[^/\"']*/[^/\"']*" ${ROOTCATALOG}
37
38 if set_dtds; then
39 for d in ${DTDS}; do
40 populate_dtd ${d}
41 done
42 + for d in ${SIMPLE_DTDS}; do
43 + populate_simple_dtd ${d}
44 + done
45 populate_entities
46 fi
47
48 @@ -66,6 +69,7 @@
49 #
50 set_dtds() {
51 DTDS=$(find ${DOCBOOKDIR} -path '*/xml-dtd-*/docbookx.dtd')
52 + SIMPLE_DTDS=$(find ${DOCBOOKDIR} -path '*/xml-simple-dtd-*/sdocbook.dtd')
53 if [[ -z ${DTDS} ]]; then
54 echo "No installed DocBook XML DTDs found"
55 return 1
56 @@ -177,6 +181,28 @@
57 fi
58 }
59
60 +#
61 +# populate a specific simple dtd version into the docbook catalog
62 +# $1 == /path/to/sdocbook.dtd
63 +#
64 +populate_simple_dtd() {
65 + typeset dtd=$1 docbookdir=${1%/*}
66 + typeset v=${docbookdir##*-}
67 +
68 + # sanity check
69 + if [[ ${dtd} != */xml-simple-dtd-*/* ]]; then
70 + echo "Warning: I don't understand \"${dtd}\"" >&2
71 + return
72 + fi
73 + echo "Found Simplified DocBook XML ${v} in ${docbookdir}"
74 +
75 + # Populate the docbook catalog with this version
76 + verb " Populating ${CATALOG} based on ${docbookdir}"
77 + xmlcatalog --noout --add "public" "-//OASIS//DTD Simplified DocBook XML V${v}//EN" "file://${docbookdir}/sdocbook.dtd" ${CATALOG}
78 + xmlcatalog --noout --add "rewriteSystem" "http://www.oasis-open.org/docbook/xml/simple/${v}" "file://${docbookdir}" ${CATALOG}
79 + xmlcatalog --noout --add "rewriteURI" "http://www.oasis-open.org/docbook/xml/simple/${v}" "file://${docbookdir}" ${CATALOG}
80 +}
81 +
82 #
83 # populate ISO DocBook entities from the most recent DTD
84 #