Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Pascal Bach <pascal.bach@siemens.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] package.bbclass: allow additional variables to be added to pkgdata
Date: Thu, 19 Jan 2017 10:16:37 +0100	[thread overview]
Message-ID: <1484817397-7308-2-git-send-email-pascal.bach@siemens.com> (raw)
In-Reply-To: <1484817397-7308-1-git-send-email-pascal.bach@siemens.com>

Adding variable names to the variable PACKAGE_EXTRA_PKGDATA allows including
this variables in the pkgdata file of a package.

For example PACKAGE_EXTRA_PKGDATA = "MACHINE" will add the MACHINE variable to
pkgdata. These fields can be used later in the process by some custom package
processing for example during image creation.

Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
---
 meta/classes/package.bbclass | 8 +++++++-
 meta/conf/documentation.conf | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 568b85c..2ed1ecc 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1388,6 +1388,11 @@ python emit_pkgdata() {
             write_if_exists(sf, pkg, 'FILERDEPENDS_' + dfile)
 
         sf.write('%s_%s: %d\n' % ('PKGSIZE', pkg, total_size))
+
+        # Write additional variables listed in PACKAGE_EXTRA_PKGDATA
+        for extra_var in (d.getVar('PACKAGE_EXTRA_PKGDATA') or "").split():
+            write_if_exists(sf, pkg, extra_var)
+
         sf.close()
 
         # Symlinks needed for rprovides lookup
@@ -1986,12 +1991,13 @@ 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 ALTERNATIVE PKGE PKGV PKGR USERADD_PARAM GROUPADD_PARAM CONFFILES SYSTEMD_SERVICE LICENSE SECTION pkg_preinst pkg_prerm RREPLACES GROUPMEMS_PARAM SYSTEMD_AUTO_ENABLE"
+PACKAGEVARS = "FILES RDEPENDS RRECOMMENDS SUMMARY DESCRIPTION RSUGGESTS RPROVIDES RCONFLICTS PKG ALLOW_EMPTY pkg_postinst pkg_postrm INITSCRIPT_NAME INITSCRIPT_PARAMS DEBIAN_NOAUTONAME ALTERNATIVE PKGE PKGV PKGR USERADD_PARAM GROUPADD_PARAM CONFFILES SYSTEMD_SERVICE LICENSE SECTION pkg_preinst pkg_prerm RREPLACES GROUPMEMS_PARAM SYSTEMD_AUTO_ENABLE PACKAGE_EXTRA_PKGDATA"
 
 def gen_packagevar(d):
     ret = []
     pkgs = (d.getVar("PACKAGES") or "").split()
     vars = (d.getVar("PACKAGEVARS") or "").split()
+    vars.extend((d.getVar("PACKAGE_EXTRA_PKGDATA") or "").split())
     for p in pkgs:
         for v in vars:
             ret.append(v + "_" + p)
diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf
index 06527cb..e0fb8cf 100644
--- a/meta/conf/documentation.conf
+++ b/meta/conf/documentation.conf
@@ -311,6 +311,7 @@ PACKAGE_BEFORE_PN[doc] = "Enables easily adding packages to PACKAGES before ${PN
 PACKAGE_CLASSES[doc] = "This variable specifies the package manager to use when packaging data. It is set in the conf/local.conf file in the Build Directory."
 PACKAGE_EXCLUDE[doc] = "Packages to exclude from the installation. If a listed package is required, an error is generated."
 PACKAGE_EXTRA_ARCHS[doc] = "Specifies the list of architectures compatible with the device CPU. This variable is useful when you build for several different devices that use miscellaneous processors."
+PACKAGE_EXTRA_PKGDATA[doc] = "Additional variables to be included in a packages pkgdata."
 PACKAGE_GROUP[doc] = "Defines one or more packages to include in an image when a specific item is included in IMAGE_FEATURES."
 PACKAGE_INSTALL[doc] = "List of the packages to be installed into the image. The variable is generally not user-defined and uses IMAGE_INSTALL as part of the list."
 PACKAGE_INSTALL_ATTEMPTONLY[doc] = "List of packages attempted to be installed. If a listed package fails to install, the build system does not generate an error. This variable is generally not user-defined."
-- 
2.1.4



  reply	other threads:[~2017-01-19  9:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-19  9:16 Passing additional data from packages to be used during image creation Pascal Bach
2017-01-19  9:16 ` Pascal Bach [this message]
2017-01-21 11:44 ` Richard Purdie
2017-01-24  9:12   ` Pascal Bach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1484817397-7308-2-git-send-email-pascal.bach@siemens.com \
    --to=pascal.bach@siemens.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox