From fd1517e2b51a170f2427122c6b95396db251d827 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 10 Aug 2022 14:35:29 +0100 Subject: classes: Update classes to match new bitbake class scope functionality Move classes to classes-global or classes-recipe as appropriate to take advantage of new bitbake functionality to check class scope/usage. (From OE-Core rev: f5c128008365e141082c129417eb72d2751e8045) Signed-off-by: Richard Purdie --- meta/classes-recipe/xmlcatalog.bbclass | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 meta/classes-recipe/xmlcatalog.bbclass (limited to 'meta/classes-recipe/xmlcatalog.bbclass') diff --git a/meta/classes-recipe/xmlcatalog.bbclass b/meta/classes-recipe/xmlcatalog.bbclass new file mode 100644 index 0000000000..5826d0a8b5 --- /dev/null +++ b/meta/classes-recipe/xmlcatalog.bbclass @@ -0,0 +1,32 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +DEPENDS = "libxml2-native" + +# A whitespace-separated list of XML catalogs to be registered, for example +# "${sysconfdir}/xml/docbook-xml.xml". +XMLCATALOGS ?= "" + +SYSROOT_PREPROCESS_FUNCS:append = " xmlcatalog_sstate_postinst" + +xmlcatalog_complete() { + ROOTCATALOG="${STAGING_ETCDIR_NATIVE}/xml/catalog" + if [ ! -f $ROOTCATALOG ]; then + mkdir --parents $(dirname $ROOTCATALOG) + 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 +} -- cgit v1.2.3-54-g00ecf