From patchwork Tue Oct 2 19:03:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/2] Makefile: Fix target-purgelocales Date: Tue, 02 Oct 2012 09:03:50 -0000 From: Valentine Barshak X-Patchwork-Id: 188623 Message-Id: <1349204631-21077-2-git-send-email-gvaxon@gmail.com> To: buildroot@busybox.net The /usr/share/X11/locale/locale.dir file is needed by libX11. Removing it breaks locale support in X11. However, make removes not only directories but also all files, which are not listed in the BR2_ENABLE_LOCALE_WHITELIST. This re-creates locale.dir database file where needed. Signed-off-by: Valentine Barshak --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 0128839..009debe 100644 --- a/Makefile +++ b/Makefile @@ -478,11 +478,13 @@ target-purgelocales: for dir in $(wildcard $(addprefix $(TARGET_DIR),/usr/share/locale /usr/share/X11/locale /usr/man /usr/share/man)); \ do \ - for lang in $$(cd $$dir; ls .|grep -v man); \ + (cd $$dir && rm -f locale.dir && \ + for lang in $$(ls .|grep -v "man\|locale\.dir"); \ do \ - grep -qx $$lang $(LOCALE_WHITELIST) || rm -rf $$dir/$$lang; \ - done; \ - done + grep -qx $$lang $(LOCALE_WHITELIST) || rm -rf $$lang; \ + [ ! -f $$lang/XLC_LOCALE ] || echo "$$lang/XLC_LOCALE: $$lang" >> locale.dir; \ + done) \ + done; endif ifneq ($(GENERATE_LOCALE),)