purge-locales: further refactoring after removing man paths
authorArnout Vandecappelle <arnout@mind.be>
Mon, 13 Jul 2015 23:45:27 +0000 (01:45 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 14 Jul 2015 00:11:25 +0000 (02:11 +0200)
Since the man paths have been removed, it is no longer necessary to
grep them out and the loop can be simplified.

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

index 02a103244290c1411a7156d75cb89ab61d811a95..f764ae5419c0f5919108388325e52758ab32a747 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -546,9 +546,9 @@ define PURGE_LOCALES
 
        for dir in $(wildcard $(addprefix $(TARGET_DIR),/usr/share/locale /usr/share/X11/locale /usr/lib/locale)); \
        do \
-               for lang in $$(cd $$dir; ls .|grep -v man); \
+               for langdir in $$dir/*; \
                do \
-                       grep -qx $$lang $(LOCALE_WHITELIST) || rm -rf $$dir/$$lang; \
+                       grep -qx $${langdir##*/} $(LOCALE_WHITELIST) || rm -rf $$langdir; \
                done; \
        done
 endef