[sys-apps/keyboard-configuration-helpers] revision bump, add /etc/vconsole.conf support

This commit is contained in:
Fabio Erculiani
2013-04-20 15:46:51 +01:00
parent e88f88b974
commit f29d4f755f
2 changed files with 18 additions and 1 deletions
@@ -30,7 +30,9 @@ def _configure_system(root, keymap, variant, options):
'mm', 'mn', 'mt', 'mv', 'ng', 'pk', 'si', 'sy', 'th', 'uz', 'vn', 'za']
for k in vt_keymaps_fixes_us:
vt_keymaps_fixes[k] = "us"
confd_keymaps = os.path.join(root, "etc/conf.d/keymaps")
vconsole_conf = os.path.join(root, "etc/vconsole.conf")
sys_key = vt_keymaps_fixes.get(keymap, keymap)
output = []
@@ -48,6 +50,21 @@ def _configure_system(root, keymap, variant, options):
f.flush()
os.rename(confd_keymaps+".tmp", confd_keymaps)
# /etc/vconsole.conf support
output = []
if os.path.isfile(vconsole_conf):
with open(vconsole_conf, "r") as f:
for line in f.readlines():
if line.startswith("KEYMAP="):
continue
output.append(line)
output.append("KEYMAP=%s\n" % (sys_key,))
with open(vconsole_conf+".tmp", "w") as f:
f.writelines(output)
f.flush()
os.rename(vconsole_conf+".tmp", vconsole_conf)
return 0
def _configure_xorg(root, keymap, variant, options):
@@ -1,4 +1,4 @@
# Copyright 2011 Fabio Erculiani
# Copyright 2004-2013 Sabayon
# Distributed under the terms of the GNU General Public License v2
DESCRIPTION="Sabayon Keyboard configuration wrapper"