Skip to contentSkip to conversation

utils.bbclass: add helper function to add all multilib variants of a specific package

PATCH In review Matthew McClintock 2 participants 2 messages Jul 5, 2012 – Jul 9, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 utils.bbclass: add helper function to add all multilib variants of a specific package

From: Richard Purdie <[email protected]>

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

---
RP was the author of this patch via pastebin only... I thought I would properly attribute it to him

 meta/classes/utils.bbclass |    9 +++++++++
 1 file changed, 9 insertions(+)
meta/classes/utils.bbclass +9 -0
index fde8f44..cc3acfa 100644
@@ -351,6 +351,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 = []
Signature · 1 line
1.7.10
#1 lore raw
Quoted 24 lines · Matthew McClintock

From: Richard Purdie <[email protected]>

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

---
RP was the author of this patch via pastebin only... I thought I would properly attribute it to him

  meta/classes/utils.bbclass |    9 +++++++++
  1 file changed, 9 insertions(+)
meta/classes/utils.bbclass +2 -0
index fde8f44..cc3acfa 100644
@@ -351,6 +351,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()

meta/classes/utils.bbclass def extend_variants(d, var, extend, delim=':'): · line 365

Quoted 10 lines
meta/classes/utils.bbclass +7 -0
+	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 = []

Merged this along with the MakeMaker patch

Thanks
Sau!