* [PATCH 0/4] SGML catalog generation fixes
@ 2011-02-23 6:22 Scott Garman
2011-02-23 6:22 ` [PATCH 1/4] sstate.bbclass: add SSTATEPOSTINSTFUNCS Scott Garman
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Scott Garman @ 2011-02-23 6:22 UTC (permalink / raw)
To: poky
From: Scott Garman <scott.a.garman@intel.com>
Hi Saul,
This pull request improves the way the SGML catalog files are
generated in the native sysroot. Richard helped out with the
addition of SSTATEPOSTINSTFUNCS when we realized there was no
way to dynamically run a post-install script when doing a build
from sstate cache.
I believe this should fix bug #748.
Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: sgarman/sgml-catalog-fixes
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=sgarman/sgml-catalog-fixes
Thanks,
Scott Garman <scott.a.garman@intel.com>
---
Scott Garman (4):
sstate.bbclass: add SSTATEPOSTINSTFUNCS
docbook-sgml-dtd-native.inc: run install-catalog from
SSTATEPOSTINSTFUNCS
docbook-dsssl-stylesheets-native: run install-catalog from
SSTATEPOSTINSTFUNCS
openjade-native: run install-catalog from SSTATEPOSTINSTFUNCS
meta/classes/sstate.bbclass | 8 +++++
.../docbook-dsssl-stylesheets-native_1.79.bb | 30 ++++++++------------
.../docbook-sgml-dtd/docbook-sgml-dtd-native.inc | 26 ++++++----------
.../openjade/openjade-native_1.3.2.bb | 17 ++++++++---
4 files changed, 42 insertions(+), 39 deletions(-)
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] sstate.bbclass: add SSTATEPOSTINSTFUNCS
2011-02-23 6:22 [PATCH 0/4] SGML catalog generation fixes Scott Garman
@ 2011-02-23 6:22 ` Scott Garman
2011-02-23 16:21 ` Richard Purdie
2011-02-23 6:23 ` [PATCH 2/4] docbook-sgml-dtd-native.inc: run install-catalog from SSTATEPOSTINSTFUNCS Scott Garman
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Scott Garman @ 2011-02-23 6:22 UTC (permalink / raw)
To: poky
From: Scott Garman <scott.a.garman@intel.com>
When doing builds using sstate cache, there was no way to run
the equivalent of a pkg_postinst function. This is needed by
the SGML-related documentation recipes to properly update the
catalog files when new DTDs and stylesheets are installed.
SSTATEPOSTINSTFUNCS is a new variable you can set to function(s)
in your recipe to run after install is completed from sstate.
Thanks to Richard Purdie for suggesting this solution.
Signed-off-by: Scott Garman <scott.a.garman@intel.com>
---
meta/classes/sstate.bbclass | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 4f1bc39..33e5829 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -16,6 +16,8 @@ BB_HASHFILENAME = "${SSTATE_PKGNAME}"
SSTATE_MANMACH ?= "${SSTATE_PKGARCH}"
+SSTATEPOSTINSTFUNCS ?= ""
+
python () {
if bb.data.inherits_class('native', d):
bb.data.setVar('SSTATE_PKGARCH', bb.data.getVar('BUILD_ARCH', d), d)
@@ -129,6 +131,12 @@ def sstate_install(ss, d):
f.write(di + "\n")
f.close()
+ # This is used for running post-install functions for sstate packages
+ # which need to generate dynamic data. Various SGML-related recipes
+ # need this to update the super catalog correctly.
+ for postinst in (bb.data.getVar('SSTATEPOSTINSTFUNCS', d, True) or '').split():
+ bb.build.exec_func(postinst, d)
+
for lock in locks:
bb.utils.unlockfile(lock)
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] docbook-sgml-dtd-native.inc: run install-catalog from SSTATEPOSTINSTFUNCS
2011-02-23 6:22 [PATCH 0/4] SGML catalog generation fixes Scott Garman
2011-02-23 6:22 ` [PATCH 1/4] sstate.bbclass: add SSTATEPOSTINSTFUNCS Scott Garman
@ 2011-02-23 6:23 ` Scott Garman
2011-02-23 6:23 ` [PATCH 3/4] docbook-dsssl-stylesheets-native: " Scott Garman
2011-02-23 6:23 ` [PATCH 4/4] openjade-native: " Scott Garman
3 siblings, 0 replies; 6+ messages in thread
From: Scott Garman @ 2011-02-23 6:23 UTC (permalink / raw)
To: poky
From: Scott Garman <scott.a.garman@intel.com>
Otherwise the sgml-docbook.cat catalog would not be updated when a build
from sstate cache is run.
Signed-off-by: Scott Garman <scott.a.garman@intel.com>
---
.../docbook-sgml-dtd/docbook-sgml-dtd-native.inc | 26 +++++++------------
1 files changed, 10 insertions(+), 16 deletions(-)
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 162051f..83cedbc 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
@@ -20,9 +20,9 @@ SRC_URI = "http://www.docbook.org/sgml/${DTD_VERSION}/docbook-${DTD_VERSION}.zip
# The .zip file extracts to the current dir
S = "${WORKDIR}"
-INC_PR = "r0"
+INC_PR = "r1"
-SYSROOT_PREPROCESS_FUNCS += "docbook_sgml_dtd_native_mangle"
+SSTATEPOSTINSTFUNCS += "docbook_sgml_dtd_sstate_postinst"
inherit native
@@ -33,21 +33,15 @@ do_install () {
install docbook.cat ${D}${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}/catalog
cp -PpRr *.dtd *.mod *.dcl ${D}${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}
- install-catalog \
- --add ${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat \
- ${D}${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}/catalog
-
- install-catalog \
- --add ${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat \
- ${sysconfdir}/sgml/sgml-docbook.cat
-
- # Copy the generated catalog to the image directory for staging.
install -d ${D}${sysconfdir}/sgml
- cp ${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat ${D}${sysconfdir}/sgml/
+ echo "CATALOG ${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}/catalog" > \
+ ${D}${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat
}
-docbook_sgml_dtd_native_mangle () {
- # Remove the image directory path ${D} from the .cat files.
- sed -i -e "s|${D}||g" ${SYSROOT_DESTDIR}${sysconfdir}/sgml/sgml-docbook.cat || true
- sed -i -e "s|${D}||g" ${SYSROOT_DESTDIR}${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat
+docbook_sgml_dtd_sstate_postinst () {
+ # Ensure that the catalog file sgml-docbook.cat is properly
+ # updated when the package is installed from sstate cache.
+ install-catalog \
+ --add ${sysconfdir}/sgml/sgml-docbook.cat \
+ ${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat
}
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] docbook-dsssl-stylesheets-native: run install-catalog from SSTATEPOSTINSTFUNCS
2011-02-23 6:22 [PATCH 0/4] SGML catalog generation fixes Scott Garman
2011-02-23 6:22 ` [PATCH 1/4] sstate.bbclass: add SSTATEPOSTINSTFUNCS Scott Garman
2011-02-23 6:23 ` [PATCH 2/4] docbook-sgml-dtd-native.inc: run install-catalog from SSTATEPOSTINSTFUNCS Scott Garman
@ 2011-02-23 6:23 ` Scott Garman
2011-02-23 6:23 ` [PATCH 4/4] openjade-native: " Scott Garman
3 siblings, 0 replies; 6+ messages in thread
From: Scott Garman @ 2011-02-23 6:23 UTC (permalink / raw)
To: poky
From: Scott Garman <scott.a.garman@intel.com>
Otherwise the sgml-docbook.cat catalog would not be updated when a build
from sstate cache is run.
Signed-off-by: Scott Garman <scott.a.garman@intel.com>
---
.../docbook-dsssl-stylesheets-native_1.79.bb | 30 ++++++++------------
1 files changed, 12 insertions(+), 18 deletions(-)
diff --git a/meta/recipes-devtools/docbook-dsssl-stylesheets/docbook-dsssl-stylesheets-native_1.79.bb b/meta/recipes-devtools/docbook-dsssl-stylesheets/docbook-dsssl-stylesheets-native_1.79.bb
index 53e9865..fc4d266 100644
--- a/meta/recipes-devtools/docbook-dsssl-stylesheets/docbook-dsssl-stylesheets-native_1.79.bb
+++ b/meta/recipes-devtools/docbook-dsssl-stylesheets/docbook-dsssl-stylesheets-native_1.79.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://README;beginline=41;endline=74;md5=875385159b2ee76ecf
DEPENDS = "sgml-common-native"
-PR = "r1"
+PR = "r2"
SRC_URI = "${SOURCEFORGE_MIRROR}/docbook/docbook-dsssl-${PV}.tar.bz2"
@@ -18,7 +18,7 @@ S = "${WORKDIR}/docbook-dsssl-${PV}"
inherit native
-SYSROOT_PREPROCESS_FUNCS += "docbook_dssl_stylesheets_native_mangle"
+SSTATEPOSTINSTFUNCS += "docbook_dsssl_stylesheets_sstate_postinst"
do_install () {
# Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/docbook-dsssl.html
@@ -30,23 +30,17 @@ do_install () {
install -m 0644 catalog ${D}${datadir}/sgml/docbook/dsssl-stylesheets-${PV}
cp -v -R * ${D}${datadir}/sgml/docbook/dsssl-stylesheets-${PV}
- install-catalog --add ${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat \
- ${D}${datadir}/sgml/docbook/dsssl-stylesheets-${PV}/catalog
-
- install-catalog --add ${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat \
- ${D}${datadir}/sgml/docbook/dsssl-stylesheets-${PV}/common/catalog
-
- install-catalog --add ${sysconfdir}/sgml/sgml-docbook.cat \
- ${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat
-
- # Move these to the image directory so they get staged properly.
install -d ${D}${sysconfdir}/sgml
- cp ${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat ${D}${sysconfdir}/sgml/
- cp ${sysconfdir}/sgml/sgml-docbook.cat ${D}${sysconfdir}/sgml/
- cp ${sysconfdir}/sgml/catalog ${D}${sysconfdir}/sgml/
+ echo "CATALOG ${datadir}/sgml/docbook/dsssl-stylesheets-${PV}/catalog" > \
+ ${D}${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat
+ echo "CATALOG ${datadir}/sgml/docbook/dsssl-stylesheets-${PV}/common/catalog" >> \
+ ${D}${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat
}
-docbook_dssl_stylesheets_native_mangle () {
- # Remove the image directory path ${D} from the .cat file.
- sed -i -e "s|${D}||g" ${SYSROOT_DESTDIR}${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat
+docbook_dsssl_stylesheets_sstate_postinst () {
+ # Ensure that the catalog file sgml-docbook.cat is properly
+ # updated when the package is installed from sstate cache.
+ install-catalog \
+ --add ${sysconfdir}/sgml/sgml-docbook.cat \
+ ${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat
}
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] openjade-native: run install-catalog from SSTATEPOSTINSTFUNCS
2011-02-23 6:22 [PATCH 0/4] SGML catalog generation fixes Scott Garman
` (2 preceding siblings ...)
2011-02-23 6:23 ` [PATCH 3/4] docbook-dsssl-stylesheets-native: " Scott Garman
@ 2011-02-23 6:23 ` Scott Garman
3 siblings, 0 replies; 6+ messages in thread
From: Scott Garman @ 2011-02-23 6:23 UTC (permalink / raw)
To: poky
From: Scott Garman <scott.a.garman@intel.com>
Otherwise the sgml-docbook.cat catalog would not be updated when a build
from sstate cache is run.
Signed-off-by: Scott Garman <scott.a.garman@intel.com>
---
.../openjade/openjade-native_1.3.2.bb | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 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 3615ec3..e8a7c45 100644
--- a/meta/recipes-devtools/openjade/openjade-native_1.3.2.bb
+++ b/meta/recipes-devtools/openjade/openjade-native_1.3.2.bb
@@ -29,6 +29,8 @@ CONFIGUREOPTS := "${@d.getVar('CONFIGUREOPTS', True).replace('--datadir=${datadi
CFLAGS =+ "-I${S}/include"
+SSTATEPOSTINSTFUNCS += "openjade_sstate_postinst"
+
do_install() {
# Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/openjade.html
# for details.
@@ -44,13 +46,18 @@ do_install() {
install -m 644 dsssl/catalog ${D}${datadir}/sgml/openjade-${PV}
install -m 644 dsssl/*.{dtd,dsl,sgm} ${D}${datadir}/sgml/openjade-${PV}
- # The catalog must live in the sysroot and it must be there for
- # install-catalog to do its thing.
install -d ${datadir}/sgml/openjade-${PV}
install -m 644 dsssl/catalog ${datadir}/sgml/openjade-${PV}/catalog
- install-catalog --add ${sysconfdir}/sgml/openjade-${PV}.cat \
- ${datadir}/sgml/openjade-${PV}/catalog
- install-catalog --add ${sysconfdir}/sgml/sgml-docbook.cat \
+ install -d ${D}${sysconfdir}/sgml
+ echo "CATALOG ${datadir}/sgml/openjade-${PV}/catalog" > \
+ ${D}${sysconfdir}/sgml/openjade-${PV}.cat
+}
+
+openjade_sstate_postinst() {
+ # Ensure that the catalog file sgml-docbook.cat is properly
+ # updated when the package is installed from sstate cache.
+ install-catalog \
+ --add ${sysconfdir}/sgml/sgml-docbook.cat \
${sysconfdir}/sgml/openjade-${PV}.cat
}
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/4] sstate.bbclass: add SSTATEPOSTINSTFUNCS
2011-02-23 6:22 ` [PATCH 1/4] sstate.bbclass: add SSTATEPOSTINSTFUNCS Scott Garman
@ 2011-02-23 16:21 ` Richard Purdie
0 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2011-02-23 16:21 UTC (permalink / raw)
To: Scott Garman; +Cc: poky
On Tue, 2011-02-22 at 22:22 -0800, Scott Garman wrote:
> From: Scott Garman <scott.a.garman@intel.com>
>
> When doing builds using sstate cache, there was no way to run
> the equivalent of a pkg_postinst function. This is needed by
> the SGML-related documentation recipes to properly update the
> catalog files when new DTDs and stylesheets are installed.
>
> SSTATEPOSTINSTFUNCS is a new variable you can set to function(s)
> in your recipe to run after install is completed from sstate.
>
> Thanks to Richard Purdie for suggesting this solution.
I merged this but I did drop your comments from the class. In the
general class code, comments about specific use cases become inaccurate
quickly and you'd usually just use grep to determine a variable's users.
Cheers,
Richard
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-02-23 16:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-23 6:22 [PATCH 0/4] SGML catalog generation fixes Scott Garman
2011-02-23 6:22 ` [PATCH 1/4] sstate.bbclass: add SSTATEPOSTINSTFUNCS Scott Garman
2011-02-23 16:21 ` Richard Purdie
2011-02-23 6:23 ` [PATCH 2/4] docbook-sgml-dtd-native.inc: run install-catalog from SSTATEPOSTINSTFUNCS Scott Garman
2011-02-23 6:23 ` [PATCH 3/4] docbook-dsssl-stylesheets-native: " Scott Garman
2011-02-23 6:23 ` [PATCH 4/4] openjade-native: " Scott Garman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.