Patchwork [1/2] libc-package bbclass: fix binary localedata dependency code

login
register
mail settings
Submitter Koen Kooi
Date Aug. 24, 2011, 6:32 p.m.
Message ID <1314210721-29941-1-git-send-email-koen@dominion.thruhere.net>
Download mbox | patch
Permalink /patch/10497/
State New, archived
Headers show

Comments

Koen Kooi - Aug. 24, 2011, 6:32 p.m.
When using binary locales rootfs generation fails with:

| Unknown package 'locale-base-en-us'.
| Collected errors:
|  * opkg_install_cmd: Cannot install package locale-base-en-us.

This is due to:

$ dpkg-deb -I ipk/armv7a/locale-base-en-us_2.12-r16_armv7a.ipk | grep Depends
 Depends: eglibc-binary-localedata-en.us

Note the '.' seperator

$ ls ipk/armv7a/ | grep binary-localedata-en | grep us
eglibc-binary-localedata-en-us_2.12-r16_armv7a.ipk

Note the '-' seperator vs the '.' in the locale-base packages.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 meta/classes/libc-package.bbclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Richard Purdie - Aug. 25, 2011, 2:26 a.m.
On Wed, 2011-08-24 at 20:32 +0200, Koen Kooi wrote:
> When using binary locales rootfs generation fails with:
> 
> | Unknown package 'locale-base-en-us'.
> | Collected errors:
> |  * opkg_install_cmd: Cannot install package locale-base-en-us.
> 
> This is due to:
> 
> $ dpkg-deb -I ipk/armv7a/locale-base-en-us_2.12-r16_armv7a.ipk | grep Depends
>  Depends: eglibc-binary-localedata-en.us
> 
> Note the '.' seperator
> 
> $ ls ipk/armv7a/ | grep binary-localedata-en | grep us
> eglibc-binary-localedata-en-us_2.12-r16_armv7a.ipk
> 
> Note the '-' seperator vs the '.' in the locale-base packages.
> 
> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>

Merged to master, thanks.

Richard
Phil Blundell - Aug. 25, 2011, 9:24 a.m.
On Wed, 2011-08-24 at 20:32 +0200, Koen Kooi wrote:
> diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass
> index 0d5ce20..d3b33d6 100644
> --- a/meta/classes/libc-package.bbclass
> +++ b/meta/classes/libc-package.bbclass
> @@ -243,7 +243,7 @@ python package_do_split_gconvs () {
>  	def output_locale_binary_rdepends(name, pkgname, locale, encoding):
>  		m = re.match("(.*)_(.*)", name)
>  		if m:
> -			libc_name = "%s.%s" % (m.group(1), m.group(2).lower().replace("-",""))
> +			libc_name = "%s-%s" % (m.group(1), m.group(2).lower().replace("-",""))
>  		else:
>  			libc_name = name
>  		bb.data.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('%s-binary-localedata-%s' \

For what it's worth (probably not much), this is not quite the right
fix.  Joining with "." was correct; it was the splitting on "_" that was
wrong.  The right thing would be to put it back how it was before the
glibc/eglibc merge commit, i.e. change the re to "(*.)\.(*.)" and leave
the output pattern alone.  That ought to fix your problem and also allow
the encoding to be correctly canonicalised.

p.
Richard Purdie - Aug. 25, 2011, 2:58 p.m.
On Thu, 2011-08-25 at 10:24 +0100, Phil Blundell wrote:
> On Wed, 2011-08-24 at 20:32 +0200, Koen Kooi wrote:
> > diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass
> > index 0d5ce20..d3b33d6 100644
> > --- a/meta/classes/libc-package.bbclass
> > +++ b/meta/classes/libc-package.bbclass
> > @@ -243,7 +243,7 @@ python package_do_split_gconvs () {
> >  	def output_locale_binary_rdepends(name, pkgname, locale, encoding):
> >  		m = re.match("(.*)_(.*)", name)
> >  		if m:
> > -			libc_name = "%s.%s" % (m.group(1), m.group(2).lower().replace("-",""))
> > +			libc_name = "%s-%s" % (m.group(1), m.group(2).lower().replace("-",""))
> >  		else:
> >  			libc_name = name
> >  		bb.data.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('%s-binary-localedata-%s' \
> 
> For what it's worth (probably not much), this is not quite the right
> fix.  Joining with "." was correct; it was the splitting on "_" that was
> wrong.  The right thing would be to put it back how it was before the
> glibc/eglibc merge commit, i.e. change the re to "(*.)\.(*.)" and leave
> the output pattern alone.  That ought to fix your problem and also allow
> the encoding to be correctly canonicalised.

Can someone please send me the correct patch against master? :)

Cheers,

Richard

Patch

diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass
index 0d5ce20..d3b33d6 100644
--- a/meta/classes/libc-package.bbclass
+++ b/meta/classes/libc-package.bbclass
@@ -243,7 +243,7 @@  python package_do_split_gconvs () {
 	def output_locale_binary_rdepends(name, pkgname, locale, encoding):
 		m = re.match("(.*)_(.*)", name)
 		if m:
-			libc_name = "%s.%s" % (m.group(1), m.group(2).lower().replace("-",""))
+			libc_name = "%s-%s" % (m.group(1), m.group(2).lower().replace("-",""))
 		else:
 			libc_name = name
 		bb.data.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('%s-binary-localedata-%s' \