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

login
register
mail settings
Submitter Matthew McClintock
Date July 5, 2012, 7:23 p.m.
Message ID <1341516191-31573-1-git-send-email-msm@freescale.com>
Download mbox | patch
Permalink /patch/31295/
State Accepted
Commit 7cd54693363882854cd026ebe071e9f2e03d364e
Headers show

Comments

Matthew McClintock - July 5, 2012, 7:23 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>
---
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(+)
Saul Wold - July 9, 2012, 4:57 p.m.
On 07/05/2012 12:23 PM, Matthew McClintock wrote:
> 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>
> ---
> 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(+)
>
> diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
> index fde8f44..cc3acfa 100644
> --- a/meta/classes/utils.bbclass
> +++ b/meta/classes/utils.bbclass
> @@ -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 = []
>

Merged this along with the MakeMaker patch

Thanks
	Sau!

Patch

diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index fde8f44..cc3acfa 100644
--- a/meta/classes/utils.bbclass
+++ b/meta/classes/utils.bbclass
@@ -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 = []