[oe-commits] Robert Yang : docbook-sgml-dtd-native: remove catalog file when do_clean

git at git.openembedded.org git at git.openembedded.org
Sun Mar 16 23:01:37 UTC 2014


Module: openembedded-core.git
Branch: master-next
Commit: 78190705c94ef22315c7ff13819ffa68c46a3127
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=78190705c94ef22315c7ff13819ffa68c46a3127

Author: Robert Yang <liezhi.yang at windriver.com>
Date:   Wed Mar 12 05:58:47 2014 +0000

docbook-sgml-dtd-native: remove catalog file when do_clean

The docbook_sgml_dtd_sstate_postinst adds catalog file to
/etc/sgml/sgml-docbook.cat and sgml-docbook.bak, but the do_clean would not
remove the file, which would cause unexpected errors since we have multiple
versions of docbook-sgml-dtd:

docbook-sgml-dtd-3.1-native_3.1.bb
docbook-sgml-dtd-4.1-native_4.1.bb
docbook-sgml-dtd-4.5-native.bb

If we run:

$ bitbake docbook-sgml-dtd-4.1-native
$ bitbake docbook-sgml-dtd-4.1-native -ccleansstate && bitbake docbook-sgml-dtd-3.1-native
$ bitbake docbook-utils-native

We would get this error:

jade: cannot open "/path/to/etc/sgml/sgml-docbook-dtd-4.1.cat" (No such file or directory)
make[2]: *** [sgmldiff.html] Error 1

Remove the catalog entry when do_clean will fix the problem.

[YOCTO #5949]

Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 .../docbook-sgml-dtd/docbook-sgml-dtd-native.inc             | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc b/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc
index 1b357b5..b2381bd 100644
--- a/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc
+++ b/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc
@@ -58,3 +58,15 @@ docbook_sgml_dtd_sysroot_preprocess () {
     install -m 755 ${STAGING_BINDIR_NATIVE}/install-catalog ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-sgml-dtd-${DTD_VERSION}
 }
 
+CLEANFUNCS += "docbook_sgml_dtd_sstate_clean"
+
+docbook_sgml_dtd_sstate_clean () {
+	# Ensure that the catalog file sgml-docbook.cat is properly
+	# updated when the package is removed from sstate cache.
+	if [ -f ${sysconfdir}/sgml/sgml-docbook.bak ]; then
+		sed -i '/'"\/sgml\/sgml-docbook-dtd-${DTD_VERSION}.cat"'/d' \
+			${sysconfdir}/sgml/sgml-docbook.bak
+		sed -i '/'"\/sgml\/sgml-docbook-dtd-${DTD_VERSION}.cat"'/d' \
+			${sysconfdir}/sgml/sgml-docbook.cat
+	fi
+}



More information about the Openembedded-commits mailing list