Hi Mark, > -----Original Message----- > From: openembedded-core-boun...@lists.openembedded.org > [mailto:openembedded-core-boun...@lists.openembedded.org] On Behalf Of > Mark Hatle > Sent: Wednesday, August 03, 2011 11:39 PM > To: openembedded-core@lists.openembedded.org > Subject: Re: [OE-core] [PATCH 6/7] package_rpm: fix strip_multilib function > > 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.ha...@windriver.com> > > Signed-off-by: Dongxiao Xu <dongxiao...@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.
The original usage for this strip_multilib() is in translate_vers() function, which strip the MLPREFIX one by one and then write the value back into variable "d". As in the last patch (PATCH 7/7), we move strip_multilib() out of translate_vers() to fix the package rename issue we met in multilib. Therefore for our new usage, we need it to remove MLPREFIX for all elements in a list at one time, thus I changed its working style. Thanks, Dongxiao > > > 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) > > > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core