vp-build/templates/OpenRC/files/locale.rc
Juan RP 6af47b83fb OpenRC: merge some local changes.
* Move all patches to xbps-changes.diff.
* Provide /etc/conf.d/locale and set "en_US" by default.
* Move rc.conf to /etc/default/rc.conf. Set unicode, rc_shell
  and rc_logger by default.
* Explain in keymaps that keyboard layout must also be specified,
  like "qwerty/es"; otherwise lodkeys will fail to use the correct
  keymap if there exists duplicate keymaps with the same name.

Bump revision.

--HG--
extra : convert_revision : 0b99d27c67cb0d7d055e769bb9a0c6b640adfe87
2009-10-10 08:39:39 +02:00

29 lines
712 B
Plaintext

#!/sbin/runscript
: ${system_locale:=en_US}
description="Sets a system locale"
depend()
{
need localmount termencoding
after bootmisc
keyword noopenvz noprefix nouml novserver noxenu
}
start()
{
: >/etc/profile.d/locale.sh
chmod 755 /etc/profile.d/locale.sh
# Check if requested locale was already created
if ! $(locale -a|grep -q "${system_locale}.utf8"); then
[ ! -d /usr/lib/locale ] && mkdir -p /usr/lib/locale
ebegin "Building locale [${system_locale}] [UTF-8]"
localedef -i ${system_locale} -f UTF-8 ${system_locale}
eend $?
fi
# Set user defined locale
einfo "Setting system locale [${system_locale}] [UTF-8]"
echo "export LANG=${system_locale}.UTF-8" >> /etc/profile.d/locale.sh
}