fedora, debian: make sure that default locale is generated
Otherwise some GUI applications would not start.
This commit is contained in:
parent
3fdb67ac2b
commit
b368ffe5c6
9
debian/qubes-core-agent.postinst
vendored
9
debian/qubes-core-agent.postinst
vendored
@ -182,6 +182,15 @@ case "${1}" in
|
|||||||
fi
|
fi
|
||||||
/usr/lib/qubes/qubes-fix-nm-conf.sh
|
/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
|
# Remove old firmware updates link
|
||||||
if [ -L /lib/firmware/updates ]; then
|
if [ -L /lib/firmware/updates ]; then
|
||||||
rm -f /lib/firmware/updates
|
rm -f /lib/firmware/updates
|
||||||
|
@ -281,7 +281,15 @@ fi
|
|||||||
# Make sure there is a default locale set so gnome-terminal will start
|
# 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
|
if [ ! -e /etc/locale.conf ] || ! grep -q LANG /etc/locale.conf; then
|
||||||
touch /etc/locale.conf
|
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
|
fi
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user