generatelocales: fix 'cut' invocation
authorArnout Vandecappelle <arnout@mind.be>
Thu, 22 Aug 2013 05:43:58 +0000 (07:43 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thu, 22 Aug 2013 21:05:43 +0000 (23:05 +0200)
'cut' needs to be invoked with the -s option to make sure it doesn't
print anything when the delimiter isn't found. This is particularly
important for the charmap detection, because UTF-8 is appended if
the charmap is empty. But without -s, it will never be empty.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Makefile

index 794d217ff5b6d9b29beb5d7fe80ea480757a6487..6018d63f696f7d81d02ef72f9e4d9fe19c3aad65 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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'.'` ; \
-               charmap=`echo $${locale} | cut -f2 -d'.'` ; \
+               inputfile=`echo $${locale} | cut -f1 -d'.' -s` ; \
+               charmap=`echo $${locale} | cut -f2 -d'.' -s` ; \
                if test -z "$${charmap}" ; then \
                        charmap="UTF-8" ; \
                fi ; \