diff options
author | Ross Burton <ross.burton@intel.com> | 2019-04-04 23:16:36 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-04-05 17:32:50 +0100 |
commit | ec43872af55602ac8c56218958418a55796be135 (patch) | |
tree | 916a631cfd7d031ed973ffd10e412dd68ea1d84e /meta/classes/xmlcatalog.bbclass | |
parent | 2958dbfcc12c6e04899a78c28f3448f9a5984193 (diff) | |
download | poky-ec43872af55602ac8c56218958418a55796be135.tar.gz |
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
(From OE-Core rev: 28c58cff76b24cea2745352c6557a81c04d85138)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/xmlcatalog.bbclass')
-rw-r--r-- | meta/classes/xmlcatalog.bbclass | 24 |
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". | ||
3 | XMLCATALOGS ?= "" | ||
4 | |||
5 | SYSROOT_PREPROCESS_FUNCS_append = " xmlcatalog_sstate_postinst" | ||
6 | |||
7 | xmlcatalog_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 | |||
18 | xmlcatalog_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 | } | ||