Skip to contentSkip to conversation

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

PATCH In review Robert Yang 1 participant 3 messages Mar 12, 2014 – Mar 13, 2014

lore
Share & tools
lore
#0 lore raw

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

The following changes since commit 1960f6b2ecbb793b40ebc9aed25c8f9cb7884c9a:

populate_sdk_deb: Fix meta-toolchain-sdk with amd64 ARCH (2014-03-11 20:28:58 -0700)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib rbt/sgml
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=rtb/sgml

Robert Yang (1):
docbook-sgml-dtd-native: remove catalog file when do_clean

 .../docbook-sgml-dtd/docbook-sgml-dtd-native.inc             |   10 ++++++++++
 1 file changed, 10 insertions(+)
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 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, 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]

---
 .../docbook-sgml-dtd/docbook-sgml-dtd-native.inc             |   10 ++++++++++
 1 file changed, 10 insertions(+)
meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc +10 -0
index 1b357b5..bf2affb 100644
@@ -58,3 +58,13 @@ 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 [ -s ${sysconfdir}/sgml/sgml-docbook.bak ]; then
+		sed -i '/'"\/sgml\/sgml-docbook-dtd-${DTD_VERSION}.cat"'/d' \
+			${sysconfdir}/sgml/sgml-docbook.bak
+	fi
+}
Signature · 1 line
1.7.10.4
#2 lore raw
Quoted 35 lines · Robert Yang

The docbook_sgml_dtd_sstate_postinst adds catalog file to /etc/sgml/sgml-docbook.cat, 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]

---
  .../docbook-sgml-dtd/docbook-sgml-dtd-native.inc             |   10 ++++++++++
  1 file changed, 10 insertions(+)
meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc +0 -0
index 1b357b5..bf2affb 100644
@@ -58,3 +58,13 @@ docbook_sgml_dtd_sysroot_preprocess () {
      install -m 755 ${STAGING_BINDIR_NATIVE}/install-catalog ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-sgml-dtd-${DTD_VERSION}

meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc docbook_sgml_dtd_sysroot_preprocess () { · line 68

Quoted 10 lines
meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc +8 -0
  }
 
+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 [ -s ${sysconfdir}/sgml/sgml-docbook.bak ]; then
+		sed -i '/'"\/sgml\/sgml-docbook-dtd-${DTD_VERSION}.cat"'/d' \
+			${sysconfdir}/sgml/sgml-docbook.bak

I updated the patch a little, we need also remove the catalog file from sgml-docbook.cat, please see the PULL:

git://git.pokylinux.org/poky-contrib rbt/sgml

And here is the patch:

meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc +0 -0
index 1b357b5..b2381bd 100644
@@ -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
+}

// Robert

Quoted 3 lines
meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc +2 -0
+	fi
+}