[oe-commits] [openembedded-core] 02/46: xmlcatalog: new class to update the XML catalogue
git at git.openembedded.org
git at git.openembedded.org
Wed Apr 3 22:21:17 UTC 2019
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit ade12f40fd601f35c75573e535f787448d79c2b1
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Wed Apr 3 18:04:04 2019 +0100
xmlcatalog: new class to update the XML catalogue
This is a new class to handle recipes that need to add/remove entries in the XML
Catalog(ue)[1]. In the future it will handle updating the catalogue on the
target, but the immediate requirement is during the build so currently this only
works with native recipes.
Note that as this is a new class and target use hasn't been implemented yet, it
is possible that the behaviour of this class will change.
[1] https://en.wikipedia.org/wiki/XML_catalog
Signed-off-by: Ross Burton <ross.burton at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/classes/xmlcatalog.bbclass | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/meta/classes/xmlcatalog.bbclass b/meta/classes/xmlcatalog.bbclass
new file mode 100644
index 0000000..dc63a0b
--- /dev/null
+++ b/meta/classes/xmlcatalog.bbclass
@@ -0,0 +1,22 @@
+XMLCATALOGS ?= ""
+
+DEPENDS_append_class-native = " libxml2-native"
+SYSROOT_PREPROCESS_FUNCS_append = " xmlcatalog_sstate_postinst"
+
+xmlcatalog_complete() {
+ ROOTCATALOG="${STAGING_ETCDIR_NATIVE}/xml/catalog"
+ if [ ! -f \$ROOTCATALOG ]; then
+ xmlcatalog --noout --create \$ROOTCATALOG
+ fi
+ for CATALOG in ${XMLCATALOGS}; do
+ xmlcatalog --noout --add nextCatalog unused file://\$CATALOG \$ROOTCATALOG
+ done
+}
+
+xmlcatalog_sstate_postinst() {
+ mkdir -p ${SYSROOT_DESTDIR}${bindir}
+ dest=${SYSROOT_DESTDIR}${bindir}/postinst-${PN}-xmlcatalog
+ echo '#!/bin/sh' > $dest
+ echo "${xmlcatalog_complete}" >> $dest
+ chmod 0755 $dest
+}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list