1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-09 17:39:31 +00:00

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>
This commit is contained in:
Richard Purdie
2016-09-15 11:48:39 +01:00
parent 0573dceb7b
commit 2a2634e10d
2 changed files with 17 additions and 19 deletions
@@ -48,7 +48,6 @@ CXXFLAGS += "-fno-tree-dse"
SSTATEPOSTINSTFUNCS += "openjade_sstate_postinst" SSTATEPOSTINSTFUNCS += "openjade_sstate_postinst"
SYSROOT_PREPROCESS_FUNCS += "openjade_sysroot_preprocess" SYSROOT_PREPROCESS_FUNCS += "openjade_sysroot_preprocess"
CLEANFUNCS += "openjade_sstate_clean"
# configure.in needs to be reloacted to trigger reautoconf # configure.in needs to be reloacted to trigger reautoconf
do_extraunpack () { do_extraunpack () {
@@ -104,6 +103,15 @@ openjade_sstate_postinst() {
${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade \ ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade \
--add ${sysconfdir}/sgml/sgml-docbook.cat \ --add ${sysconfdir}/sgml/sgml-docbook.cat \
${sysconfdir}/sgml/openjade-${PV}.cat ${sysconfdir}/sgml/openjade-${PV}.cat
cat << EOF > ${SSTATE_INST_POSTRM}
#!/bin/sh
# Ensure that the catalog file sgml-docbook.cat is properly
# updated when the package is removed from sstate cache.
files="${sysconfdir}/sgml/sgml-docbook.bak ${sysconfdir}/sgml/sgml-docbook.cat"
for f in \$files; do
[ ! -f \$f ] || sed -i '/\/sgml\/openjade-${PV}.cat/d' \$f
done
EOF
fi fi
} }
@@ -111,12 +119,3 @@ openjade_sysroot_preprocess () {
install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/ install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
install -m 755 ${STAGING_BINDIR_NATIVE}/install-catalog ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade install -m 755 ${STAGING_BINDIR_NATIVE}/install-catalog ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade
} }
openjade_sstate_clean () {
# Ensure that the catalog file sgml-docbook.cat is properly
# updated when the package is removed from sstate cache.
files="${sysconfdir}/sgml/sgml-docbook.bak ${sysconfdir}/sgml/sgml-docbook.cat"
for f in $files; do
[ ! -f $f ] || sed -i '/\/sgml\/openjade-${PV}.cat/d' $f
done
}
@@ -22,8 +22,6 @@ S = "${WORKDIR}/sgml-common-${PV}"
SYSROOT_PREPROCESS_FUNCS += "sgml_common_native_mangle" SYSROOT_PREPROCESS_FUNCS += "sgml_common_native_mangle"
SSTATEPOSTINSTFUNCS += "sgml_common_sstate_postinst" SSTATEPOSTINSTFUNCS += "sgml_common_sstate_postinst"
CLEANFUNCS += "sgml_common_sstate_clean"
do_install_append() { do_install_append() {
# install-catalog script contains hard-coded references to # install-catalog script contains hard-coded references to
@@ -59,13 +57,14 @@ sgml_common_sstate_postinst() {
fi fi
done done
fi fi
fi cat << EOF > ${SSTATE_INST_POSTRM}
} #!/bin/sh
sgml_common_sstate_clean () { # Ensure that the catalog file sgml-docbook.cat is properly
# Ensure that the catalog file sgml-docbook.cat is properly # updated when the package is removed from sstate cache.
# updated when the package is removed from sstate cache. if [ -f ${sysconfdir}/sgml/sgml-docbook.cat ]; then
if [ -f ${sysconfdir}/sgml/sgml-docbook.cat ]; then sed -i '/\/sgml\/sgml-ent.cat/d' ${sysconfdir}/sgml/sgml-docbook.cat
sed -i '/\/sgml\/sgml-ent.cat/d' ${sysconfdir}/sgml/sgml-docbook.cat fi
EOF
fi fi
} }