[OE-core] [PATCH 6/7] package_rpm: fix strip_multilib function

Mark Hatle mark.hatle at windriver.com
Wed Aug 3 15:38:53 UTC 2011


On 8/3/11 10:19 AM, Dongxiao Xu wrote:
> The previous logic could only strip MLPREFIX from the first element in
> an array, take an example, strip_multilib the [lib32-a lib32-b lib32-c]
> will result in [a lib32-b lib32-c]. This commit change it to strip all
> elements' multilib prefix.
> 
> CC: Mark Hatle <mark.hatle at windriver.com>
> Signed-off-by: Dongxiao Xu <dongxiao.xu at intel.com>
> ---
>  meta/classes/package_rpm.bbclass |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
> index 9d0eeba..a29ce9d 100644
> --- a/meta/classes/package_rpm.bbclass
> +++ b/meta/classes/package_rpm.bbclass
> @@ -326,7 +326,7 @@ python write_specfile () {
>  		for ext in multilibs.split():
>  			eext = ext.split(':')
>  			if len(eext) > 1 and eext[0] == 'multilib' and name and name.find(eext[1] + '-') == 0:
> -				name = (eext[1] + '-').join(name.split(eext[1] + '-', 1)[1:])
> +				name = " ".join(name.split(eext[1] + '-')[1:])

This looks incorrect to me, with the " ".join, it's going to join multiple
elements with a whitespace between them.  The original code was written to work
on one item at a time within the list of multilibs.

How well has this been tested?  Since I don't have all of the context this very
well might be correct within the current scope of the multilib implementation.

>  		return name
>  
>  #		ml = bb.data.getVar("MLPREFIX", d, True)
> @@ -720,7 +720,7 @@ python do_package_rpm () {
>  	def strip_multilib(name, d):
>  		ml = bb.data.getVar("MLPREFIX", d, True)
>  		if ml and name and len(ml) != 0 and name.find(ml) == 0:
> -			return ml.join(name.split(ml, 1)[1:])
> +			return " ".join(name.split(ml)[1:])
>  		return name
>  
>  	workdir = bb.data.getVar('WORKDIR', d, True)





More information about the Openembedded-core mailing list