Patchwork [5/5] libc-common.bbclass: rename ALL the packages

login
register
mail settings
Submitter Hongxu Jia
Date March 28, 2014, 9:43 a.m.
Message ID <83f0a66f2733ddb620e210ff46fbe67e86d74ceb.1395996410.git.hongxu.jia@windriver.com>
Download mbox | patch
Permalink /patch/69553/
State New
Headers show

Comments

Hongxu Jia - March 28, 2014, 9:43 a.m.
From: Peter Seebach <peter.seebach@windriver.com>

The DEBIAN_NAMES feature renames some of the libc packages to
"libc6*" names --but only some. A previous patch added the -dbg
package. However, this doesn't cover other packages (such as
the -doc package), and it didn't take multilibs into account.

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Jeff Polk <jeff.polk@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/classes/libc-common.bbclass | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
Martin Jansa - March 28, 2014, 10:17 a.m.
On Fri, Mar 28, 2014 at 05:43:54PM +0800, Hongxu Jia wrote:
> From: Peter Seebach <peter.seebach@windriver.com>
> 
> The DEBIAN_NAMES feature renames some of the libc packages to
> "libc6*" names --but only some. A previous patch added the -dbg
> package. However, this doesn't cover other packages (such as
> the -doc package), and it didn't take multilibs into account.
> 
> Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
> Signed-off-by: Jeff Polk <jeff.polk@windriver.com>
> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
>  meta/classes/libc-common.bbclass | 19 +++++++++++++------
>  1 file changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/meta/classes/libc-common.bbclass b/meta/classes/libc-common.bbclass
> index daf499d..53bf467 100644
> --- a/meta/classes/libc-common.bbclass
> +++ b/meta/classes/libc-common.bbclass
> @@ -25,12 +25,19 @@ def get_libc_fpu_setting(bb, d):
>  
>  python populate_packages_prepend () {
>      if d.getVar('DEBIAN_NAMES', True):
> +        pkgs = d.getVar('PACKAGES', True).split()
>          bpn = d.getVar('BPN', True)
> -        d.setVar('PKG_'+bpn, 'libc6')
> -        d.setVar('PKG_'+bpn+'-dev', 'libc6-dev')
> -        d.setVar('PKG_'+bpn+'-dbg', 'libc6-dbg')
> +        prefix = d.getVar('MLPREFIX', True) or ""
> +        # Set the base package...
> +        d.setVar('PKG_' + prefix + bpn, prefix + 'libc6')
> +        initial = prefix + bpn + '-'

I would prefer better variable name here, first thing on my mind when
I've seen it was eglibc-initial and I was wondering why should all libc
packages be renamed like that.

> +        for p in pkgs:
> +            # And all the subpackages.
> +            if p.startswith(initial):
> +                renamed = p.replace(bpn, 'libc6', 1)
> +                d.setVar('PKG_' + p, renamed)
>          # For backward compatibility with old -dbg package
> -        d.appendVar('RPROVIDES_' + bpn + '-dbg', ' libc-dbg')
> -        d.appendVar('RCONFLICTS_' + bpn + '-dbg', ' libc-dbg')
> -        d.appendVar('RREPLACES_' + bpn + '-dbg', ' libc-dbg')
> +        d.appendVar('RPROVIDES_' + initial + 'dbg', ' ' + prefix + 'libc-dbg')
> +        d.appendVar('RCONFLICTS_' + initial + 'dbg', ' ' + prefix + 'libc-dbg')
> +        d.appendVar('RREPLACES_' + initial + 'dbg', ' ' + prefix + 'libc-dbg')
>  }
> -- 
> 1.8.1.2
> 
> -- 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Hongxu Jia - March 28, 2014, 10:28 a.m.
On 03/28/2014 06:17 PM, Martin Jansa wrote:
> On Fri, Mar 28, 2014 at 05:43:54PM +0800, Hongxu Jia wrote:
>> From: Peter Seebach <peter.seebach@windriver.com>
>>
>> The DEBIAN_NAMES feature renames some of the libc packages to
>> "libc6*" names --but only some. A previous patch added the -dbg
>> package. However, this doesn't cover other packages (such as
>> the -doc package), and it didn't take multilibs into account.
>>
>> Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
>> Signed-off-by: Jeff Polk <jeff.polk@windriver.com>
>> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
>> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>> ---
>>   meta/classes/libc-common.bbclass | 19 +++++++++++++------
>>   1 file changed, 13 insertions(+), 6 deletions(-)
>>
>> diff --git a/meta/classes/libc-common.bbclass b/meta/classes/libc-common.bbclass
>> index daf499d..53bf467 100644
>> --- a/meta/classes/libc-common.bbclass
>> +++ b/meta/classes/libc-common.bbclass
>> @@ -25,12 +25,19 @@ def get_libc_fpu_setting(bb, d):
>>   
>>   python populate_packages_prepend () {
>>       if d.getVar('DEBIAN_NAMES', True):
>> +        pkgs = d.getVar('PACKAGES', True).split()
>>           bpn = d.getVar('BPN', True)
>> -        d.setVar('PKG_'+bpn, 'libc6')
>> -        d.setVar('PKG_'+bpn+'-dev', 'libc6-dev')
>> -        d.setVar('PKG_'+bpn+'-dbg', 'libc6-dbg')
>> +        prefix = d.getVar('MLPREFIX', True) or ""
>> +        # Set the base package...
>> +        d.setVar('PKG_' + prefix + bpn, prefix + 'libc6')
>> +        initial = prefix + bpn + '-'
> I would prefer better variable name here, first thing on my mind when
> I've seen it was eglibc-initial and I was wondering why should all libc
> packages be renamed like that.

Yep, how about 'libcprefix' instead,

s/initial/libcprefix/

//Hongxu

>> +        for p in pkgs:
>> +            # And all the subpackages.
>> +            if p.startswith(initial):
>> +                renamed = p.replace(bpn, 'libc6', 1)
>> +                d.setVar('PKG_' + p, renamed)
>>           # For backward compatibility with old -dbg package
>> -        d.appendVar('RPROVIDES_' + bpn + '-dbg', ' libc-dbg')
>> -        d.appendVar('RCONFLICTS_' + bpn + '-dbg', ' libc-dbg')
>> -        d.appendVar('RREPLACES_' + bpn + '-dbg', ' libc-dbg')
>> +        d.appendVar('RPROVIDES_' + initial + 'dbg', ' ' + prefix + 'libc-dbg')
>> +        d.appendVar('RCONFLICTS_' + initial + 'dbg', ' ' + prefix + 'libc-dbg')
>> +        d.appendVar('RREPLACES_' + initial + 'dbg', ' ' + prefix + 'libc-dbg')
>>   }
>> -- 
>> 1.8.1.2
>>
>> -- 
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/classes/libc-common.bbclass b/meta/classes/libc-common.bbclass
index daf499d..53bf467 100644
--- a/meta/classes/libc-common.bbclass
+++ b/meta/classes/libc-common.bbclass
@@ -25,12 +25,19 @@  def get_libc_fpu_setting(bb, d):
 
 python populate_packages_prepend () {
     if d.getVar('DEBIAN_NAMES', True):
+        pkgs = d.getVar('PACKAGES', True).split()
         bpn = d.getVar('BPN', True)
-        d.setVar('PKG_'+bpn, 'libc6')
-        d.setVar('PKG_'+bpn+'-dev', 'libc6-dev')
-        d.setVar('PKG_'+bpn+'-dbg', 'libc6-dbg')
+        prefix = d.getVar('MLPREFIX', True) or ""
+        # Set the base package...
+        d.setVar('PKG_' + prefix + bpn, prefix + 'libc6')
+        initial = prefix + bpn + '-'
+        for p in pkgs:
+            # And all the subpackages.
+            if p.startswith(initial):
+                renamed = p.replace(bpn, 'libc6', 1)
+                d.setVar('PKG_' + p, renamed)
         # For backward compatibility with old -dbg package
-        d.appendVar('RPROVIDES_' + bpn + '-dbg', ' libc-dbg')
-        d.appendVar('RCONFLICTS_' + bpn + '-dbg', ' libc-dbg')
-        d.appendVar('RREPLACES_' + bpn + '-dbg', ' libc-dbg')
+        d.appendVar('RPROVIDES_' + initial + 'dbg', ' ' + prefix + 'libc-dbg')
+        d.appendVar('RCONFLICTS_' + initial + 'dbg', ' ' + prefix + 'libc-dbg')
+        d.appendVar('RREPLACES_' + initial + 'dbg', ' ' + prefix + 'libc-dbg')
 }