archlinux: do not mess with locales in post-install script

Locales must be setup properly in the template.
This commit is contained in:
Olivier MEDOC 2017-10-23 07:53:23 +02:00
parent 6b68397f6f
commit 0bf69ebc24

View File

@ -130,21 +130,6 @@ EOF
done
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.UTF-8" >> /etc/locale.conf
fi
# ... and make sure it is really generated
# This line is buggy as LANG can be set to LANG="en_US.UTF-8". The Quotes must be stripped
current_locale=$(grep LANG /etc/locale.conf|cut -f 2 -d = | tr -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"
# shellcheck disable=SC2086
localedef -i "$base" $charmap "$current_locale"
fi
}
############################