From b368ffe5c690feea416274ddffcca272bcb71892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 16 Jun 2015 02:27:23 +0200 Subject: [PATCH] fedora, debian: make sure that default locale is generated Otherwise some GUI applications would not start. --- debian/qubes-core-agent.postinst | 9 +++++++++ rpm_spec/core-vm.spec | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/debian/qubes-core-agent.postinst b/debian/qubes-core-agent.postinst index f188b2f..1e14dfd 100755 --- a/debian/qubes-core-agent.postinst +++ b/debian/qubes-core-agent.postinst @@ -182,6 +182,15 @@ case "${1}" in fi /usr/lib/qubes/qubes-fix-nm-conf.sh + # make sure locale is really generated + current_locale=`grep 'LANG\|LC_ALL' /etc/default/locale|head -n 1|cut -f 2 -d =` + if [ -n "$current_locale" ] && ! locale -a | grep -q "$current_locale"; then + base=`echo "$current_locale" | cut -f 1 -d .` + charmap=`echo "$current_locale.UTF-8" | cut -f 2 -d .` + [ -n "$charmap" ] && charmap="-f $charmap" + localedef -i $base $charmap $current_locale + fi + # Remove old firmware updates link if [ -L /lib/firmware/updates ]; then rm -f /lib/firmware/updates diff --git a/rpm_spec/core-vm.spec b/rpm_spec/core-vm.spec index 7995218..42f769f 100644 --- a/rpm_spec/core-vm.spec +++ b/rpm_spec/core-vm.spec @@ -281,7 +281,15 @@ fi # Make sure there is a default locale set so gnome-terminal will start if [ ! -e /etc/locale.conf ] || ! grep -q LANG /etc/locale.conf; then touch /etc/locale.conf - echo "LANG=en_US.utf8" >> /etc/locale.conf + echo "LANG=en_US.UTF-8" >> /etc/locale.conf +fi +# ... and make sure it is really generated +current_locale=`grep LANG /etc/locale.conf|cut -f 2 -d =` +if [ -n "$current_locale" ] && ! locale -a | grep -q "$current_locale"; then + base=`echo "$current_locale" | cut -f 1 -d .` + charmap=`echo "$current_locale.UTF-8" | cut -f 2 -d .` + [ -n "$charmap" ] && charmap="-f $charmap" + localedef -i $base $charmap $current_locale fi %endif