Patchwork [CONSOLIDATED,PULL,26/41] utils.bbclass: add helper function to add all multilib variants of a specific package

login
register
mail settings
Submitter Saul Wold
Date July 9, 2012, 3:47 p.m.
Message ID <e9bdb70774aedc8b1149230b6770ffffdf40663f.1341802889.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/31505/
State New
Headers show

Comments

Saul Wold - July 9, 2012, 3:47 p.m.
From: Richard Purdie <richard.purdie@linuxfoundation.org>

This is useful for the scenario where we want to add 'gcc' to
the root file system for all multilib variants

Signed-off-by: Matthew McClintock <msm@freescale.com>
---
 meta/classes/utils.bbclass |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Patch

diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index f8b09b4..ccf78fc 100644
--- a/meta/classes/utils.bbclass
+++ b/meta/classes/utils.bbclass
@@ -325,6 +325,15 @@  def extend_variants(d, var, extend, delim=':'):
 			variants.append(eext[1])
 	return " ".join(variants)
 
+def multilib_pkg_extend(d, pkg):
+	variants = (d.getVar("MULTILIB_VARIANTS", True) or "").split()
+	if not variants:
+	    return pkg
+	pkgs = pkg
+	for v in variants:
+	    pkgs = pkgs + " " + v + "-" + pkg
+	return pkgs
+
 def all_multilib_tune_values(d, var, unique = True, need_split = True, delim = ' '):
 	"""Return a string of all ${var} in all multilib tune configuration"""
 	values = []