Skip to contentSkip to conversation

Broken generation of locales

Buildroot Thierry Bultel 3 participants 6 messages Sep 19, 2013 Kbuild

lore
Share & tools
lore
#0 lore raw

Hi,

When setting BR2_GENERATE_LOCALE, for instance like that:
BR2_GENERATE_LOCALE="fr_FR en_US es_ES es_ES.ISO-8859-1 hu_HU"

nothing is generated.

next patch fixes that issue:

Makefile +2 -2
index 7997e3b..98afd7e 100644
@@ -543,8 +543,8 @@ ifneq ($(GENERATE_LOCALE),)
  target-generatelocales: host-localedef
         $(Q)mkdir -p $(TARGET_DIR)/usr/lib/locale/
         $(Q)for locale in $(GENERATE_LOCALE) ; do \
-               inputfile=`echo $${locale} | cut -f1 -d'.' -s` ; \
-               charmap=`echo $${locale} | cut -f2 -d'.' -s` ; \
+               inputfile=`echo $${locale} | cut -f1 -d'.'` ; \
+               charmap=`echo $${locale} | cut -s -f2 -d'.'` ; \
                 if test -z "$${charmap}" ; then \
                         charmap="UTF-8" ; \
                 fi ; \

Cheers
Thierry

#1 lore raw

Dear Thierry Bultel,

Quoted 12 lines · Thierry Bultel

When setting BR2_GENERATE_LOCALE, for instance like that:
BR2_GENERATE_LOCALE="fr_FR en_US es_ES es_ES.ISO-8859-1 hu_HU"

nothing is generated.

next patch fixes that issue:

Makefile +0 -0
index 7997e3b..98afd7e 100644

Makefile ifneq ($(GENERATE_LOCALE),) · line 550

Quoted 10 lines
Makefile +2 -2
@@ -543,8 +543,8 @@ ifneq ($(GENERATE_LOCALE),)
  target-generatelocales: host-localedef
         $(Q)mkdir -p $(TARGET_DIR)/usr/lib/locale/
         $(Q)for locale in $(GENERATE_LOCALE) ; do \
-               inputfile=`echo $${locale} | cut -f1 -d'.' -s` ; \
-               charmap=`echo $${locale} | cut -f2 -d'.' -s` ; \
+               inputfile=`echo $${locale} | cut -f1 -d'.'` ; \
+               charmap=`echo $${locale} | cut -s -f2 -d'.'` ; \
                 if test -z "$${charmap}" ; then \
                         charmap="UTF-8" ; \
                 fi ; \

This exactly reverts commit 8e2696eab6a781727c09408528678d4d29edd7a3 which was merged in August. I've added Arnout in Cc so that you can discuss the issue together and decide who wins :-)

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

Hi Thomas,

This does not exactly revert the named commit, that added 's' for both inputfile and charmap.

I pretend that the 's' option is mandatory for charmap only, else inputfile is always empty:

inputfile:

thierry at thierry-desktop:~$ echo fr_FR | cut -f1 -d '.' fr_FR
thierry at thierry-desktop:~$ echo fr_FR | cut -f1 -d '.' -s thierry at thierry-desktop:~$

charmap:

thierry at thierry-desktop:~$ echo fr_FR.utf8 | cut -f2 -d '.' utf8
thierry at thierry-desktop:~$ echo fr_FR.utf8 | cut -f2 -d '.' -s utf8

thierry at thierry-desktop:~$ cut --version
cut (GNU coreutils) 7.4

Cheers
Thierry

Le 19/09/2013 17:04, Thomas Petazzoni a ?crit :

Quoted 33 lines

Dear Thierry Bultel,

Quoted 12 lines · Thierry Bultel

When setting BR2_GENERATE_LOCALE, for instance like that:
BR2_GENERATE_LOCALE="fr_FR en_US es_ES es_ES.ISO-8859-1 hu_HU"

nothing is generated.

next patch fixes that issue:

Makefile +0 -0
index 7997e3b..98afd7e 100644

Makefile ifneq ($(GENERATE_LOCALE),) · line 550

Quoted 10 lines
Makefile +2 -2
@@ -543,8 +543,8 @@ ifneq ($(GENERATE_LOCALE),)
   target-generatelocales: host-localedef
          $(Q)mkdir -p $(TARGET_DIR)/usr/lib/locale/
          $(Q)for locale in $(GENERATE_LOCALE) ; do \
-               inputfile=`echo $${locale} | cut -f1 -d'.' -s` ; \
-               charmap=`echo $${locale} | cut -f2 -d'.' -s` ; \
+               inputfile=`echo $${locale} | cut -f1 -d'.'` ; \
+               charmap=`echo $${locale} | cut -s -f2 -d'.'` ; \
                  if test -z "$${charmap}" ; then \
                          charmap="UTF-8" ; \
                  fi ; \

This exactly reverts commit 8e2696eab6a781727c09408528678d4d29edd7a3 which was merged in August. I've added Arnout in Cc so that you can discuss the issue together and decide who wins :-)

Thanks,

Thomas

#3 lore raw
Quoted 15 lines · Thierry Bultel

Hi Thomas,

This does not exactly revert the named commit, that added 's' for both inputfile and charmap.

I pretend that the 's' option is mandatory for charmap only, else inputfile is always empty:

inputfile:

thierry at thierry-desktop:~$ echo fr_FR | cut -f1 -d '.' fr_FR
thierry at thierry-desktop:~$ echo fr_FR | cut -f1 -d '.' -s thierry at thierry-desktop:~$

Quoted 6 lines

charmap:

thierry at thierry-desktop:~$ echo fr_FR.utf8 | cut -f2 -d '.' utf8
thierry at thierry-desktop:~$ echo fr_FR.utf8 | cut -f2 -d '.' -s utf8

Ack that.

So this patch gets

Note that you've caused Thomas's confusion by unnecessarily moving the
-s option in the charmap line.

Regards,
Arnout

[snip]

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#4 lore raw

Dear Arnout Vandecappelle,

Quoted 2 lines · Arnout Vandecappelle

Note that you've caused Thomas's confusion by unnecessarily moving the
-s option in the charmap line.

Ah, yes. Thierry, can you resend a proper patch (i.e without moving the -s option in the charmap line, and with a proper description and Signed-off-by line) ?

Thanks!

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#5 lore raw
Quoted 10 lines · Thomas Petazzoni

Dear Arnout Vandecappelle,

Quoted 2 lines · Arnout Vandecappelle

Note that you've caused Thomas's confusion by unnecessarily moving the
-s option in the charmap line.

Ah, yes. Thierry, can you resend a proper patch (i.e without moving the -s option in the charmap line, and with a proper description and Signed-off-by line) ?

And don't forget to add my

:-)

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F