mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-29 14:16:31 +00:00
purge-locales: fix handling of X11 locale.dir
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 <gvaxon@gmail.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> [Arnout: use a separate loop, and add some explanatory comments] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
parent
805240bae8
commit
b791571c03
15
Makefile
15
Makefile
@ -540,6 +540,11 @@ ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
|
|||||||
LOCALE_WHITELIST = $(BUILD_DIR)/locales.nopurge
|
LOCALE_WHITELIST = $(BUILD_DIR)/locales.nopurge
|
||||||
LOCALE_NOPURGE = $(call qstrip,$(BR2_ENABLE_LOCALE_WHITELIST))
|
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
|
define PURGE_LOCALES
|
||||||
rm -f $(LOCALE_WHITELIST)
|
rm -f $(LOCALE_WHITELIST)
|
||||||
for i in $(LOCALE_NOPURGE) locale-archive; do echo $$i >> $(LOCALE_WHITELIST); done
|
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; \
|
grep -qx $${langdir##*/} $(LOCALE_WHITELIST) || rm -rf $$langdir; \
|
||||||
done; \
|
done; \
|
||||||
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
|
endef
|
||||||
TARGET_FINALIZE_HOOKS += PURGE_LOCALES
|
TARGET_FINALIZE_HOOKS += PURGE_LOCALES
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user