* [PATCH] libc-package.bbclass: split binary localedata even more if asked to
@ 2016-11-30 23:50 Andreas Oberritter
2016-12-01 4:02 ` Khem Raj
0 siblings, 1 reply; 6+ messages in thread
From: Andreas Oberritter @ 2016-11-30 23:50 UTC (permalink / raw)
To: openembedded-core
If GLIBC_SPLIT_LC_PACKAGES is set to a non-zero value, convert
glibc-binary-localedata-XX-YY to be a meta package depending on
glibc-binary-localedata-XX-YY-lc-address and so on. This enables
saving quite some space if someone doesn't need LC_COLLATE for
example.
Some regex code was removed from output_locale_binary_rdepends,
because legitimize_package_name already converts to lowercase.
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
meta/classes/libc-package.bbclass | 39 +++++++++++++++++++++++++--------------
1 file changed, 25 insertions(+), 14 deletions(-)
diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass
index 2dc90c4..071978b 100644
--- a/meta/classes/libc-package.bbclass
+++ b/meta/classes/libc-package.bbclass
@@ -9,6 +9,8 @@
GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "ondevice"
+GLIBC_SPLIT_LC_PACKAGES ?= "0"
+
python __anonymous () {
enabled = d.getVar("ENABLE_BINARY_LOCALE_GENERATION", True)
@@ -219,13 +221,12 @@ python package_do_split_gconvs () {
(locale, encoding, locale))
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())
- else:
- libc_name = name
- d.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('%s-binary-localedata-%s' \
- % (mlprefix+bpn, libc_name)))
+ dep = legitimize_package_name('%s-binary-localedata-%s' % (bpn, name))
+ lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES', True)
+ if lcsplit and int(lcsplit):
+ d.appendVar('PACKAGES', ' ' + dep)
+ d.setVar('ALLOW_EMPTY_%s' % dep, '1')
+ d.setVar('RDEPENDS_%s' % pkgname, mlprefix + dep)
commands = {}
@@ -337,6 +338,11 @@ python package_do_split_gconvs () {
else:
output_locale('%s.%s' % (base, charset), base, charset)
+ def metapkg_hook(file, pkg, pattern, format, basename):
+ name = basename.split('/', 1)[0]
+ metapkg = legitimize_package_name('%s-binary-localedata-%s' % (mlprefix+bpn, name))
+ d.appendVar('RDEPENDS_%s' % metapkg, ' ' + pkg)
+
if use_bin == "compile":
makefile = base_path_join(d.getVar("WORKDIR", True), "locale-tree", "Makefile")
m = open(makefile, "w")
@@ -350,13 +356,18 @@ python package_do_split_gconvs () {
bb.build.exec_func("oe_runmake", d)
bb.note("collecting binary locales from locale tree")
bb.build.exec_func("do_collect_bins_from_locale_tree", d)
- do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
- output_pattern=bpn+'-binary-localedata-%s', \
- description='binary locale definition for %s', extra_depends='', allow_dirs=True)
- elif use_bin == "precompiled":
- do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
- output_pattern=bpn+'-binary-localedata-%s', \
- description='binary locale definition for %s', extra_depends='', allow_dirs=True)
+
+ if use_bin in ('compile', 'precompiled'):
+ lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES', True)
+ if lcsplit and int(lcsplit):
+ do_split_packages(d, binary_locales_dir, file_regex='^(.*/LC_\w+)', \
+ output_pattern=bpn+'-binary-localedata-%s', \
+ description='binary locale definition for %s', recursive=True,
+ hook=metapkg_hook, extra_depends='', allow_dirs=True, match_path=True)
+ else:
+ do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
+ output_pattern=bpn+'-binary-localedata-%s', \
+ description='binary locale definition for %s', extra_depends='', allow_dirs=True)
else:
bb.note("generation of binary locales disabled. this may break i18n!")
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] libc-package.bbclass: split binary localedata even more if asked to
2016-11-30 23:50 [PATCH] libc-package.bbclass: split binary localedata even more if asked to Andreas Oberritter
@ 2016-12-01 4:02 ` Khem Raj
2016-12-01 12:33 ` Andreas Oberritter
0 siblings, 1 reply; 6+ messages in thread
From: Khem Raj @ 2016-12-01 4:02 UTC (permalink / raw)
To: Andreas Oberritter; +Cc: openembedded-core
> On Nov 30, 2016, at 3:50 PM, Andreas Oberritter <obi@opendreambox.org> wrote:
>
> If GLIBC_SPLIT_LC_PACKAGES is set to a non-zero value, convert
> glibc-binary-localedata-XX-YY to be a meta package depending on
> glibc-binary-localedata-XX-YY-lc-address and so on. This enables
> saving quite some space if someone doesn't need LC_COLLATE for
> example.
>
> Some regex code was removed from output_locale_binary_rdepends,
> because legitimize_package_name already converts to lowercase.
>
This looks ok. May be add some documentation around
GLIBC_SPLIT_LC_PACKAGES in extended local.conf sample.
I am worried about dependency changes, may be comparing old and new
would help.
> Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
> ---
> meta/classes/libc-package.bbclass | 39 +++++++++++++++++++++++++--------------
> 1 file changed, 25 insertions(+), 14 deletions(-)
>
> diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass
> index 2dc90c4..071978b 100644
> --- a/meta/classes/libc-package.bbclass
> +++ b/meta/classes/libc-package.bbclass
> @@ -9,6 +9,8 @@
>
> GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "ondevice"
>
> +GLIBC_SPLIT_LC_PACKAGES ?= "0"
> +
> python __anonymous () {
> enabled = d.getVar("ENABLE_BINARY_LOCALE_GENERATION", True)
>
> @@ -219,13 +221,12 @@ python package_do_split_gconvs () {
> (locale, encoding, locale))
>
> 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())
> - else:
> - libc_name = name
> - d.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('%s-binary-localedata-%s' \
> - % (mlprefix+bpn, libc_name)))
> + dep = legitimize_package_name('%s-binary-localedata-%s' % (bpn, name))
> + lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES', True)
> + if lcsplit and int(lcsplit):
> + d.appendVar('PACKAGES', ' ' + dep)
> + d.setVar('ALLOW_EMPTY_%s' % dep, '1')
> + d.setVar('RDEPENDS_%s' % pkgname, mlprefix + dep)
>
> commands = {}
>
> @@ -337,6 +338,11 @@ python package_do_split_gconvs () {
> else:
> output_locale('%s.%s' % (base, charset), base, charset)
>
> + def metapkg_hook(file, pkg, pattern, format, basename):
> + name = basename.split('/', 1)[0]
> + metapkg = legitimize_package_name('%s-binary-localedata-%s' % (mlprefix+bpn, name))
> + d.appendVar('RDEPENDS_%s' % metapkg, ' ' + pkg)
> +
> if use_bin == "compile":
> makefile = base_path_join(d.getVar("WORKDIR", True), "locale-tree", "Makefile")
> m = open(makefile, "w")
> @@ -350,13 +356,18 @@ python package_do_split_gconvs () {
> bb.build.exec_func("oe_runmake", d)
> bb.note("collecting binary locales from locale tree")
> bb.build.exec_func("do_collect_bins_from_locale_tree", d)
> - do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
> - output_pattern=bpn+'-binary-localedata-%s', \
> - description='binary locale definition for %s', extra_depends='', allow_dirs=True)
> - elif use_bin == "precompiled":
> - do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
> - output_pattern=bpn+'-binary-localedata-%s', \
> - description='binary locale definition for %s', extra_depends='', allow_dirs=True)
> +
> + if use_bin in ('compile', 'precompiled'):
> + lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES', True)
> + if lcsplit and int(lcsplit):
> + do_split_packages(d, binary_locales_dir, file_regex='^(.*/LC_\w+)', \
> + output_pattern=bpn+'-binary-localedata-%s', \
> + description='binary locale definition for %s', recursive=True,
> + hook=metapkg_hook, extra_depends='', allow_dirs=True, match_path=True)
> + else:
> + do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
> + output_pattern=bpn+'-binary-localedata-%s', \
> + description='binary locale definition for %s', extra_depends='', allow_dirs=True)
> else:
> bb.note("generation of binary locales disabled. this may break i18n!")
>
> --
> 2.7.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] libc-package.bbclass: split binary localedata even more if asked to
2016-12-01 4:02 ` Khem Raj
@ 2016-12-01 12:33 ` Andreas Oberritter
2016-12-01 12:37 ` [PATCH v2] " Andreas Oberritter
2016-12-01 16:51 ` [PATCH] " Khem Raj
0 siblings, 2 replies; 6+ messages in thread
From: Andreas Oberritter @ 2016-12-01 12:33 UTC (permalink / raw)
To: Khem Raj; +Cc: openembedded-core
On 01.12.2016 05:02, Khem Raj wrote:
>
>> On Nov 30, 2016, at 3:50 PM, Andreas Oberritter <obi@opendreambox.org> wrote:
>>
>> If GLIBC_SPLIT_LC_PACKAGES is set to a non-zero value, convert
>> glibc-binary-localedata-XX-YY to be a meta package depending on
>> glibc-binary-localedata-XX-YY-lc-address and so on. This enables
>> saving quite some space if someone doesn't need LC_COLLATE for
>> example.
>>
>> Some regex code was removed from output_locale_binary_rdepends,
>> because legitimize_package_name already converts to lowercase.
>>
>
> This looks ok. May be add some documentation around
> GLIBC_SPLIT_LC_PACKAGES in extended local.conf sample.
OK, will send a v2.
> I am worried about dependency changes, may be comparing old and new
> would help.
The generated meta packages make sure that dependencies stay intact. I
didn't observe any deviation in my test builds, with or without setting
GLIBC_SPLIT_LC_PACKAGES to 1.
Regards,
Andreas
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] libc-package.bbclass: split binary localedata even more if asked to
2016-12-01 12:33 ` Andreas Oberritter
@ 2016-12-01 12:37 ` Andreas Oberritter
2016-12-01 16:51 ` [PATCH] " Khem Raj
1 sibling, 0 replies; 6+ messages in thread
From: Andreas Oberritter @ 2016-12-01 12:37 UTC (permalink / raw)
To: openembedded-core
If GLIBC_SPLIT_LC_PACKAGES is set to a non-zero value, convert
glibc-binary-localedata-XX-YY to be a meta package depending on
glibc-binary-localedata-XX-YY-lc-address and so on. This enables
saving quite some space if someone doesn't need LC_COLLATE for
example.
Some regex code was removed from output_locale_binary_rdepends,
because legitimize_package_name already converts to lowercase.
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
v2: Added description to local.conf.sample.extended.
meta/classes/libc-package.bbclass | 39 +++++++++++++++++++++++-------------
meta/conf/local.conf.sample.extended | 7 +++++++
2 files changed, 32 insertions(+), 14 deletions(-)
diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass
index 2dc90c4..071978b 100644
--- a/meta/classes/libc-package.bbclass
+++ b/meta/classes/libc-package.bbclass
@@ -9,6 +9,8 @@
GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "ondevice"
+GLIBC_SPLIT_LC_PACKAGES ?= "0"
+
python __anonymous () {
enabled = d.getVar("ENABLE_BINARY_LOCALE_GENERATION", True)
@@ -219,13 +221,12 @@ python package_do_split_gconvs () {
(locale, encoding, locale))
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())
- else:
- libc_name = name
- d.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('%s-binary-localedata-%s' \
- % (mlprefix+bpn, libc_name)))
+ dep = legitimize_package_name('%s-binary-localedata-%s' % (bpn, name))
+ lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES', True)
+ if lcsplit and int(lcsplit):
+ d.appendVar('PACKAGES', ' ' + dep)
+ d.setVar('ALLOW_EMPTY_%s' % dep, '1')
+ d.setVar('RDEPENDS_%s' % pkgname, mlprefix + dep)
commands = {}
@@ -337,6 +338,11 @@ python package_do_split_gconvs () {
else:
output_locale('%s.%s' % (base, charset), base, charset)
+ def metapkg_hook(file, pkg, pattern, format, basename):
+ name = basename.split('/', 1)[0]
+ metapkg = legitimize_package_name('%s-binary-localedata-%s' % (mlprefix+bpn, name))
+ d.appendVar('RDEPENDS_%s' % metapkg, ' ' + pkg)
+
if use_bin == "compile":
makefile = base_path_join(d.getVar("WORKDIR", True), "locale-tree", "Makefile")
m = open(makefile, "w")
@@ -350,13 +356,18 @@ python package_do_split_gconvs () {
bb.build.exec_func("oe_runmake", d)
bb.note("collecting binary locales from locale tree")
bb.build.exec_func("do_collect_bins_from_locale_tree", d)
- do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
- output_pattern=bpn+'-binary-localedata-%s', \
- description='binary locale definition for %s', extra_depends='', allow_dirs=True)
- elif use_bin == "precompiled":
- do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
- output_pattern=bpn+'-binary-localedata-%s', \
- description='binary locale definition for %s', extra_depends='', allow_dirs=True)
+
+ if use_bin in ('compile', 'precompiled'):
+ lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES', True)
+ if lcsplit and int(lcsplit):
+ do_split_packages(d, binary_locales_dir, file_regex='^(.*/LC_\w+)', \
+ output_pattern=bpn+'-binary-localedata-%s', \
+ description='binary locale definition for %s', recursive=True,
+ hook=metapkg_hook, extra_depends='', allow_dirs=True, match_path=True)
+ else:
+ do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
+ output_pattern=bpn+'-binary-localedata-%s', \
+ description='binary locale definition for %s', extra_depends='', allow_dirs=True)
else:
bb.note("generation of binary locales disabled. this may break i18n!")
diff --git a/meta/conf/local.conf.sample.extended b/meta/conf/local.conf.sample.extended
index 57f656a..f7cabf0 100644
--- a/meta/conf/local.conf.sample.extended
+++ b/meta/conf/local.conf.sample.extended
@@ -47,6 +47,13 @@
# less than 128MB RAM.
#ENABLE_BINARY_LOCALE_GENERATION = "1"
+# If GLIBC_SPLIT_LC_PACKAGES is set to a non-zero value, convert
+# glibc-binary-localedata-XX-YY to be a meta package depending on
+# glibc-binary-localedata-XX-YY-lc-address and so on. This enables
+# saving quite some space if someone doesn't need LC_COLLATE for
+# example.
+#GLIBC_SPLIT_LC_PACKAGES = "1"
+
# Set GLIBC_GENERATE_LOCALES to the locales you wish to generate should you not
# wish to perform the time-consuming step of generating all LIBC locales.
# NOTE: If removing en_US.UTF-8 you will also need to uncomment, and set
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] libc-package.bbclass: split binary localedata even more if asked to
2016-12-01 12:33 ` Andreas Oberritter
2016-12-01 12:37 ` [PATCH v2] " Andreas Oberritter
@ 2016-12-01 16:51 ` Khem Raj
2016-12-01 19:25 ` Andreas Oberritter
1 sibling, 1 reply; 6+ messages in thread
From: Khem Raj @ 2016-12-01 16:51 UTC (permalink / raw)
To: Andreas Oberritter; +Cc: Patches and discussions about the oe-core layer
On Thu, Dec 1, 2016 at 4:33 AM, Andreas Oberritter <obi@opendreambox.org> wrote:
> On 01.12.2016 05:02, Khem Raj wrote:
>>
>>> On Nov 30, 2016, at 3:50 PM, Andreas Oberritter <obi@opendreambox.org> wrote:
>>>
>>> If GLIBC_SPLIT_LC_PACKAGES is set to a non-zero value, convert
>>> glibc-binary-localedata-XX-YY to be a meta package depending on
>>> glibc-binary-localedata-XX-YY-lc-address and so on. This enables
>>> saving quite some space if someone doesn't need LC_COLLATE for
>>> example.
>>>
>>> Some regex code was removed from output_locale_binary_rdepends,
>>> because legitimize_package_name already converts to lowercase.
>>>
>>
>> This looks ok. May be add some documentation around
>> GLIBC_SPLIT_LC_PACKAGES in extended local.conf sample.
>
> OK, will send a v2.
>
>> I am worried about dependency changes, may be comparing old and new
>> would help.
>
> The generated meta packages make sure that dependencies stay intact. I
> didn't observe any deviation in my test builds, with or without setting
> GLIBC_SPLIT_LC_PACKAGES to 1.
Thats comforting. did you also try a online package upgrade ?
>
> Regards,
> Andreas
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] libc-package.bbclass: split binary localedata even more if asked to
2016-12-01 16:51 ` [PATCH] " Khem Raj
@ 2016-12-01 19:25 ` Andreas Oberritter
0 siblings, 0 replies; 6+ messages in thread
From: Andreas Oberritter @ 2016-12-01 19:25 UTC (permalink / raw)
To: Khem Raj; +Cc: Patches and discussions about the oe-core layer
On 01.12.2016 17:51, Khem Raj wrote:
> On Thu, Dec 1, 2016 at 4:33 AM, Andreas Oberritter <obi@opendreambox.org> wrote:
>> On 01.12.2016 05:02, Khem Raj wrote:
>>>
>>>> On Nov 30, 2016, at 3:50 PM, Andreas Oberritter <obi@opendreambox.org> wrote:
>>>>
>>>> If GLIBC_SPLIT_LC_PACKAGES is set to a non-zero value, convert
>>>> glibc-binary-localedata-XX-YY to be a meta package depending on
>>>> glibc-binary-localedata-XX-YY-lc-address and so on. This enables
>>>> saving quite some space if someone doesn't need LC_COLLATE for
>>>> example.
>>>>
>>>> Some regex code was removed from output_locale_binary_rdepends,
>>>> because legitimize_package_name already converts to lowercase.
>>>>
>>>
>>> This looks ok. May be add some documentation around
>>> GLIBC_SPLIT_LC_PACKAGES in extended local.conf sample.
>>
>> OK, will send a v2.
>>
>>> I am worried about dependency changes, may be comparing old and new
>>> would help.
>>
>> The generated meta packages make sure that dependencies stay intact. I
>> didn't observe any deviation in my test builds, with or without setting
>> GLIBC_SPLIT_LC_PACKAGES to 1.
>
> Thats comforting. did you also try a online package upgrade ?
Yes, but you can't switch existing package feeds from one setting to
another with deb, because of file conflicts (unless you run apt-get -f
install after upgrading). This would need additional RREPLACES,
RCONFLICTS (and RBREAKS?) statements, which IMHO are impossible to
automate. I'm not sure about other package managers. But it's a very
common problem when moving files from one package to another.
Regards,
Andreas
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-12-01 19:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-30 23:50 [PATCH] libc-package.bbclass: split binary localedata even more if asked to Andreas Oberritter
2016-12-01 4:02 ` Khem Raj
2016-12-01 12:33 ` Andreas Oberritter
2016-12-01 12:37 ` [PATCH v2] " Andreas Oberritter
2016-12-01 16:51 ` [PATCH] " Khem Raj
2016-12-01 19:25 ` Andreas Oberritter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox