summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-15 11:48:39 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-16 15:24:02 +0100
commit2a2634e10debd81bb95fe7be5df92f89d67f80e2 (patch)
treeeb32ce1a59537ec2fa5301fb95464f5e55e36c37
parent0573dceb7ba9488cb62e08f8e139a75e32ca33ea (diff)
downloadpoky-2a2634e10debd81bb95fe7be5df92f89d67f80e2.tar.gz
openjade/sgml-common: Add sstate postrm commands
If you bump the PR of sgml-common and openjade-native but not sgml- common-native, you will see a failure as files were removed from the sysroot but still referenced by the sgml docbook catalog. To properly handle this, the clean function needs to run at sstate removal time, the problem is that this sstate removal can happen when the metadata isn't present, so the correct removal commands are unknown. To avoid this, we need to write the commands into a "postrm" script when we install the files, this can then be executed at sstate removal time. [YOCTO #8273] (From OE-Core rev: cdae3e76232110903d124195b036e4e70fb28aa4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/openjade/openjade-native_1.3.2.bb19
-rw-r--r--meta/recipes-devtools/sgml-common/sgml-common-native_0.6.3.bb17
2 files changed, 17 insertions, 19 deletions
diff --git a/meta/recipes-devtools/openjade/openjade-native_1.3.2.bb b/meta/recipes-devtools/openjade/openjade-native_1.3.2.bb
index afcb8ca13a..8b15b0c7ec 100644
--- a/meta/recipes-devtools/openjade/openjade-native_1.3.2.bb
+++ b/meta/recipes-devtools/openjade/openjade-native_1.3.2.bb
@@ -48,7 +48,6 @@ CXXFLAGS += "-fno-tree-dse"
48 48
49SSTATEPOSTINSTFUNCS += "openjade_sstate_postinst" 49SSTATEPOSTINSTFUNCS += "openjade_sstate_postinst"
50SYSROOT_PREPROCESS_FUNCS += "openjade_sysroot_preprocess" 50SYSROOT_PREPROCESS_FUNCS += "openjade_sysroot_preprocess"
51CLEANFUNCS += "openjade_sstate_clean"
52 51
53# configure.in needs to be reloacted to trigger reautoconf 52# configure.in needs to be reloacted to trigger reautoconf
54do_extraunpack () { 53do_extraunpack () {
@@ -104,6 +103,15 @@ openjade_sstate_postinst() {
104 ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade \ 103 ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade \
105 --add ${sysconfdir}/sgml/sgml-docbook.cat \ 104 --add ${sysconfdir}/sgml/sgml-docbook.cat \
106 ${sysconfdir}/sgml/openjade-${PV}.cat 105 ${sysconfdir}/sgml/openjade-${PV}.cat
106 cat << EOF > ${SSTATE_INST_POSTRM}
107#!/bin/sh
108# Ensure that the catalog file sgml-docbook.cat is properly
109# updated when the package is removed from sstate cache.
110files="${sysconfdir}/sgml/sgml-docbook.bak ${sysconfdir}/sgml/sgml-docbook.cat"
111for f in \$files; do
112 [ ! -f \$f ] || sed -i '/\/sgml\/openjade-${PV}.cat/d' \$f
113done
114EOF
107 fi 115 fi
108} 116}
109 117
@@ -111,12 +119,3 @@ openjade_sysroot_preprocess () {
111 install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/ 119 install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
112 install -m 755 ${STAGING_BINDIR_NATIVE}/install-catalog ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade 120 install -m 755 ${STAGING_BINDIR_NATIVE}/install-catalog ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade
113} 121}
114
115openjade_sstate_clean () {
116 # Ensure that the catalog file sgml-docbook.cat is properly
117 # updated when the package is removed from sstate cache.
118 files="${sysconfdir}/sgml/sgml-docbook.bak ${sysconfdir}/sgml/sgml-docbook.cat"
119 for f in $files; do
120 [ ! -f $f ] || sed -i '/\/sgml\/openjade-${PV}.cat/d' $f
121 done
122}
diff --git a/meta/recipes-devtools/sgml-common/sgml-common-native_0.6.3.bb b/meta/recipes-devtools/sgml-common/sgml-common-native_0.6.3.bb
index 597536570d..97b308a88b 100644
--- a/meta/recipes-devtools/sgml-common/sgml-common-native_0.6.3.bb
+++ b/meta/recipes-devtools/sgml-common/sgml-common-native_0.6.3.bb
@@ -22,8 +22,6 @@ S = "${WORKDIR}/sgml-common-${PV}"
22 22
23SYSROOT_PREPROCESS_FUNCS += "sgml_common_native_mangle" 23SYSROOT_PREPROCESS_FUNCS += "sgml_common_native_mangle"
24SSTATEPOSTINSTFUNCS += "sgml_common_sstate_postinst" 24SSTATEPOSTINSTFUNCS += "sgml_common_sstate_postinst"
25CLEANFUNCS += "sgml_common_sstate_clean"
26
27 25
28do_install_append() { 26do_install_append() {
29 # install-catalog script contains hard-coded references to 27 # install-catalog script contains hard-coded references to
@@ -59,13 +57,14 @@ sgml_common_sstate_postinst() {
59 fi 57 fi
60 done 58 done
61 fi 59 fi
62 fi 60 cat << EOF > ${SSTATE_INST_POSTRM}
63} 61#!/bin/sh
64 62
65sgml_common_sstate_clean () { 63# Ensure that the catalog file sgml-docbook.cat is properly
66 # Ensure that the catalog file sgml-docbook.cat is properly 64# updated when the package is removed from sstate cache.
67 # updated when the package is removed from sstate cache. 65if [ -f ${sysconfdir}/sgml/sgml-docbook.cat ]; then
68 if [ -f ${sysconfdir}/sgml/sgml-docbook.cat ]; then 66 sed -i '/\/sgml\/sgml-ent.cat/d' ${sysconfdir}/sgml/sgml-docbook.cat
69 sed -i '/\/sgml\/sgml-ent.cat/d' ${sysconfdir}/sgml/sgml-docbook.cat 67fi
68EOF
70 fi 69 fi
71} 70}