summaryrefslogtreecommitdiffstats
path: root/meta/classes/xmlcatalog.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/xmlcatalog.bbclass')
-rw-r--r--meta/classes/xmlcatalog.bbclass24
1 files changed, 24 insertions, 0 deletions
diff --git a/meta/classes/xmlcatalog.bbclass b/meta/classes/xmlcatalog.bbclass
new file mode 100644
index 0000000000..075aef8c0c
--- /dev/null
+++ b/meta/classes/xmlcatalog.bbclass
@@ -0,0 +1,24 @@
1# A whitespace-separated list of XML catalogs to be registered, for example
2# "${sysconfdir}/xml/docbook-xml.xml".
3XMLCATALOGS ?= ""
4
5SYSROOT_PREPROCESS_FUNCS_append = " xmlcatalog_sstate_postinst"
6
7xmlcatalog_complete() {
8 ROOTCATALOG="${STAGING_ETCDIR_NATIVE}/xml/catalog"
9 if [ ! -f $ROOTCATALOG ]; then
10 mkdir --parents $(dirname $ROOTCATALOG)
11 xmlcatalog --noout --create $ROOTCATALOG
12 fi
13 for CATALOG in ${XMLCATALOGS}; do
14 xmlcatalog --noout --add nextCatalog unused file://$CATALOG $ROOTCATALOG
15 done
16}
17
18xmlcatalog_sstate_postinst() {
19 mkdir -p ${SYSROOT_DESTDIR}${bindir}
20 dest=${SYSROOT_DESTDIR}${bindir}/postinst-${PN}-xmlcatalog
21 echo '#!/bin/sh' > $dest
22 echo '${xmlcatalog_complete}' >> $dest
23 chmod 0755 $dest
24}