From patchwork Mon Jul 13 22:15:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 494788 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id A18C514076A for ; Tue, 14 Jul 2015 08:16:04 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3CD6AA381D; Mon, 13 Jul 2015 22:16:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s0Yxzp2TgRyn; Mon, 13 Jul 2015 22:15:56 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id D1D6CA365E; Mon, 13 Jul 2015 22:15:55 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 75CF61C2893 for ; Mon, 13 Jul 2015 22:15:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 70C0132B1A for ; Mon, 13 Jul 2015 22:15:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZnPMZIYh6BQS for ; Mon, 13 Jul 2015 22:15:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from exchange.essensium.com (220.77.144.195.ipv4.evonet.be [195.144.77.220]) by silver.osuosl.org (Postfix) with ESMTPS id DAA6832AB0 for ; Mon, 13 Jul 2015 22:15:52 +0000 (UTC) Received: from vandecaa-laptop.home (10.3.7.11) by beleexch01.local.ess-mail.com (10.3.7.8) with Microsoft SMTP Server (TLS) id 15.0.847.32; Tue, 14 Jul 2015 00:15:38 +0200 From: "Arnout Vandecappelle (Essensium/Mind)" To: Date: Tue, 14 Jul 2015 00:15:37 +0200 Message-ID: <1436825737-6264-2-git-send-email-arnout@mind.be> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1436825737-6264-1-git-send-email-arnout@mind.be> References: <1436825737-6264-1-git-send-email-arnout@mind.be> MIME-Version: 1.0 X-Originating-IP: [10.3.7.11] X-ClientProxiedBy: beleexch01.local.ess-mail.com (10.3.7.8) To beleexch01.local.ess-mail.com (10.3.7.8) Cc: Valentine Barshak Subject: [Buildroot] [PATCH v2 2/2] Makefile: Fix target-purgelocales X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Valentine Barshak 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 Signed-off-by: Arnout Vandecappelle (Essensium/Mind) [Arnout: use a separate loop, and add some explanatory comments] --- Makefile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Makefile b/Makefile index a26f87d..bfc2e17 100644 --- a/Makefile +++ b/Makefile @@ -540,6 +540,11 @@ ifeq ($(BR2_ENABLE_LOCALE_PURGE),y) LOCALE_WHITELIST = $(BUILD_DIR)/locales.nopurge LOCALE_NOPURGE = $(call qstrip,$(BR2_ENABLE_LOCALE_WHITELIST)) +# This piece of junk does the following: +# First collect the whitelist in a file. +# Then go over all the locale dirs and for each subdir, check if it exists +# in the whitelist file. If it doesn't, kill it. +# Finally, specifically for X11, regenerate locale.dir from the whitelist. define PURGE_LOCALES rm -f $(LOCALE_WHITELIST) for i in $(LOCALE_NOPURGE) locale-archive; do echo $$i >> $(LOCALE_WHITELIST); done @@ -551,6 +556,16 @@ define PURGE_LOCALES grep -qx $${langdir##*/} $(LOCALE_WHITELIST) || rm -rf $$langdir; \ done; \ done + if [ -d $(TARGET_DIR)/usr/share/X11/locale ]; \ + then \ + for lang in $(LOCALE_NOPURGE); \ + do \ + if [ -f $(TARGET_DIR)/usr/share/X11/locale/$$lang/XLC_LOCALE ]; \ + then \ + echo "$$lang/XLC_LOCALE: $$lang"; \ + fi \ + done > $(TARGET_DIR)/usr/share/X11/locale/locale.dir; \ + fi endef TARGET_FINALIZE_HOOKS += PURGE_LOCALES endif