Patchwork [2/2] Add some (mostly packaging) vardeps

login
register
mail settings
Submitter Chris Larson
Date Nov. 16, 2011, 9:17 p.m.
Message ID <CABcZAN=EfT=jtKRBgfuvMWyipDRxWiac+kSxm8qoBZxjjcej=g@mail.gmail.com>
Download mbox | patch
Permalink /patch/15061/
State New
Headers show

Comments

Chris Larson - Nov. 16, 2011, 9:17 p.m.
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
---
 meta/classes/package.bbclass       |   17 ++++++++++++++++-
 meta/classes/package_deb.bbclass   |    1 +
 meta/classes/package_ipk.bbclass   |    1 +
 meta/classes/package_rpm.bbclass   |    1 +
 meta/classes/sstate.bbclass        |    2 ++
 meta/classes/utility-tasks.bbclass |    1 +
 6 files changed, 22 insertions(+), 1 deletions(-)
Richard Purdie - Nov. 16, 2011, 11:42 p.m.
On Wed, 2011-11-16 at 14:17 -0700, Chris Larson wrote:
> Signed-off-by: Christopher Larson <chris_larson@mentor.com>
> ---
>  meta/classes/package.bbclass       |   17 ++++++++++++++++-
>  meta/classes/package_deb.bbclass   |    1 +
>  meta/classes/package_ipk.bbclass   |    1 +
>  meta/classes/package_rpm.bbclass   |    1 +
>  meta/classes/sstate.bbclass        |    2 ++
>  meta/classes/utility-tasks.bbclass |    1 +
>  6 files changed, 22 insertions(+), 1 deletions(-)
> 
> diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
> index d01275f..11de0e3 100644
> --- a/meta/classes/package.bbclass
> +++ b/meta/classes/package.bbclass
> @@ -1102,6 +1102,7 @@ python emit_pkgdata() {
> 
>  	bb.utils.unlockfile(lf)
>  }
> +emit_pkgdata[vardeps] += "${@gen_package_filedep_var(d)}"
>  emit_pkgdata[dirs] = "${PKGDESTWORK}/runtime"
> 
>  ldconfig_postinst_fragment() {
> @@ -1182,6 +1183,7 @@ python package_do_filedeps() {
>  		bb.data.setVar("FILERDEPENDSFLIST_" + pkg, " ".join(requires_files), d)
>  		bb.data.setVar("FILERPROVIDESFLIST_" + pkg, " ".join(provides_files), d)
>  }
> +package_do_filedeps[vardeps] += "${@gen_package_filedep_var(d)}"
> 
>  SHLIBSDIR = "${STAGING_DIR_HOST}/shlibs"
>  SHLIBSWORKDIR = "${WORKDIR}/shlibs"
> @@ -1646,7 +1648,7 @@ python package_depchains() {
> 
>  # Since bitbake can't determine which variables are accessed during package
>  # iteration, we need to list them here:
> -PACKAGEVARS = "FILES RDEPENDS RRECOMMENDS SUMMARY DESCRIPTION
> RSUGGESTS RPROVIDES RCONFLICTS PKG ALLOW_EMPTY pkg_postinst pkg_postrm
> INITSCRIPT_NAME INITSCRIPT_PARAMS DEBIAN_NOAUTONAME"
> +PACKAGEVARS = "FILES RDEPENDS RRECOMMENDS SUMMARY DESCRIPTION
> RSUGGESTS RPROVIDES RCONFLICTS PKG ALLOW_EMPTY pkg_postinst
> pkg_preinst pkg_postrm pkg_prerm INITSCRIPT_NAME INITSCRIPT_PARAMS
> DEBIAN_NOAUTONAME PKGV PKGR"
> 
>  def gen_packagevar(d):
>      ret = []
> @@ -1657,6 +1659,19 @@ def gen_packagevar(d):
>              ret.append(v + "_" + p)
>      return " ".join(ret)
> 
> +def gen_package_filedep_var(d):
> +    ret = []
> +    pkgs = (d.getVar("PACKAGES", True) or "").split()
> +    for pkg in pkgs:
> +        ret.append('FILERPROVIDESFLIST_' + pkg)
> +        for rpfile in (d.getVar('FILERPROVIDESFLIST_' + pkg, True) or
> "").split():
> +            ret.append('FILERPROVIDES_%s_%s' % (rpfile, pkg))
> +
> +        ret.append('FILERDEPENDSFLIST_' + pkg)
> +        for rpfile in (d.getVar('FILERDEPENDSFLIST_' + pkg, True) or
> "").split():
> +            ret.append('FILERDEPENDS_%s_%s' % (rpfile, pkg))
> +    return ret
> +
>  PACKAGE_PREPROCESS_FUNCS ?= ""
>  PACKAGEFUNCS ?= "package_get_auto_pr \	
>                  perform_packagecopy \
> diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
> index 71e46a8..4a5c6b6 100644
> --- a/meta/classes/package_deb.bbclass
> +++ b/meta/classes/package_deb.bbclass
> @@ -393,6 +393,7 @@ python do_package_deb () {
>          bb.utils.prunedir(controldir)
>          bb.utils.unlockfile(lf)
>  }
> +do_package_deb[vardeps] += "${@gen_packagevar(d)}"

For these functions, can we assume that since they depend on
do_package's signature as a task they depend on, they'd pull in changes
to the packaging variables that way?

Cheers,

Richard

Patch

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index d01275f..11de0e3 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1102,6 +1102,7 @@  python emit_pkgdata() {

 	bb.utils.unlockfile(lf)
 }
+emit_pkgdata[vardeps] += "${@gen_package_filedep_var(d)}"
 emit_pkgdata[dirs] = "${PKGDESTWORK}/runtime"

 ldconfig_postinst_fragment() {
@@ -1182,6 +1183,7 @@  python package_do_filedeps() {
 		bb.data.setVar("FILERDEPENDSFLIST_" + pkg, " ".join(requires_files), d)
 		bb.data.setVar("FILERPROVIDESFLIST_" + pkg, " ".join(provides_files), d)
 }
+package_do_filedeps[vardeps] += "${@gen_package_filedep_var(d)}"

 SHLIBSDIR = "${STAGING_DIR_HOST}/shlibs"
 SHLIBSWORKDIR = "${WORKDIR}/shlibs"
@@ -1646,7 +1648,7 @@  python package_depchains() {

 # Since bitbake can't determine which variables are accessed during package
 # iteration, we need to list them here:
-PACKAGEVARS = "FILES RDEPENDS RRECOMMENDS SUMMARY DESCRIPTION
RSUGGESTS RPROVIDES RCONFLICTS PKG ALLOW_EMPTY pkg_postinst pkg_postrm
INITSCRIPT_NAME INITSCRIPT_PARAMS DEBIAN_NOAUTONAME"
+PACKAGEVARS = "FILES RDEPENDS RRECOMMENDS SUMMARY DESCRIPTION
RSUGGESTS RPROVIDES RCONFLICTS PKG ALLOW_EMPTY pkg_postinst
pkg_preinst pkg_postrm pkg_prerm INITSCRIPT_NAME INITSCRIPT_PARAMS
DEBIAN_NOAUTONAME PKGV PKGR"

 def gen_packagevar(d):
     ret = []
@@ -1657,6 +1659,19 @@  def gen_packagevar(d):
             ret.append(v + "_" + p)
     return " ".join(ret)

+def gen_package_filedep_var(d):
+    ret = []
+    pkgs = (d.getVar("PACKAGES", True) or "").split()
+    for pkg in pkgs:
+        ret.append('FILERPROVIDESFLIST_' + pkg)
+        for rpfile in (d.getVar('FILERPROVIDESFLIST_' + pkg, True) or
"").split():
+            ret.append('FILERPROVIDES_%s_%s' % (rpfile, pkg))
+
+        ret.append('FILERDEPENDSFLIST_' + pkg)
+        for rpfile in (d.getVar('FILERDEPENDSFLIST_' + pkg, True) or
"").split():
+            ret.append('FILERDEPENDS_%s_%s' % (rpfile, pkg))
+    return ret
+
 PACKAGE_PREPROCESS_FUNCS ?= ""
 PACKAGEFUNCS ?= "package_get_auto_pr \	
                 perform_packagecopy \
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 71e46a8..4a5c6b6 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -393,6 +393,7 @@  python do_package_deb () {
         bb.utils.prunedir(controldir)
         bb.utils.unlockfile(lf)
 }
+do_package_deb[vardeps] += "${@gen_packagevar(d)}"

 SSTATETASKS += "do_package_write_deb"
 do_package_write_deb[sstate-name] = "deploy-deb"
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index df608fc..f9ba229 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -425,6 +425,7 @@  python do_package_ipk () {
 		bb.utils.unlockfile(lf)

 }
+do_package_ipk[vardeps] += "${@gen_packagevar(d)}"

 SSTATETASKS += "do_package_write_ipk"
 do_package_write_ipk[sstate-name] = "deploy-ipk"
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 2ace053..bcf94b8 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -837,6 +837,7 @@  python write_specfile () {

 	specfile.close()
 }
+write_specfile[vardeps] += "${@gen_packagevar(d)}"

 python do_package_rpm () {
 	import os
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index a777c79..0a863cf 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -144,6 +144,7 @@  def sstate_install(ss, d):

     for lock in locks:
         bb.utils.unlockfile(lock)
+sstate_install[vardeps] += "${SSTATEPOSTINSTFUNCS}"

 def sstate_installpkg(ss, d):
     import oe.path
@@ -215,6 +216,7 @@  def sstate_clean_cachefiles(d):
     for task in (d.getVar('SSTATETASKS', True) or "").split():
         ss = sstate_state_fromvars(d, task[3:])
         sstate_clean_cachefile(ss, d)
+sstate_clean_cachefiles[vardeps] += "${SSTATETASKS}"

 def sstate_clean_manifest(manifest, d):
     import oe.path
diff --git a/meta/classes/utility-tasks.bbclass
b/meta/classes/utility-tasks.bbclass
index 009ef1f..afd078e 100644
--- a/meta/classes/utility-tasks.bbclass
+++ b/meta/classes/utility-tasks.bbclass
@@ -27,6 +27,7 @@  python do_clean() {
 	for f in (d.getVar('CLEANFUNCS', 1) or '').split():
 		bb.build.exec_func(f, d)
 }
+do_clean[vardeps] += "${CLEANFUNCS}"

 addtask checkuri
 do_checkuri[nostamp] = "1"