diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-08-29 09:50:32 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-08-29 09:50:32 +0000 |
commit | 3454aef11964e13a3097158e0c398d02b0327559 (patch) | |
tree | 1ed7f696311edac7cae2b1865ab40a269372e6a7 /perl-install/keyboard.pm | |
parent | 701635b319c0153cf68896d34cb74b2906e02407 (diff) | |
download | drakx-3454aef11964e13a3097158e0c398d02b0327559.tar drakx-3454aef11964e13a3097158e0c398d02b0327559.tar.gz drakx-3454aef11964e13a3097158e0c398d02b0327559.tar.bz2 drakx-3454aef11964e13a3097158e0c398d02b0327559.tar.xz drakx-3454aef11964e13a3097158e0c398d02b0327559.zip |
fix DISABLE_WINDOWS_KEY state handling (for upgrade), cleanup
Diffstat (limited to 'perl-install/keyboard.pm')
-rw-r--r-- | perl-install/keyboard.pm | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/perl-install/keyboard.pm b/perl-install/keyboard.pm index 066e32ea1..463fe41cc 100644 --- a/perl-install/keyboard.pm +++ b/perl-install/keyboard.pm @@ -228,8 +228,6 @@ arch() eq "ppc" ? ( )), ); -my $disable_windows_key = (detect_devices::isLaptop() ? "yes" : "no"); - #-###################################################################################### #- Functions #-###################################################################################### @@ -358,20 +356,28 @@ sub setup { sub write { my ($prefix, $keyboard, $charset, $isNotDelete) = @_; - setVarsInSh("$prefix/etc/sysconfig/keyboard", { KEYTABLE => keyboard2kmap($keyboard), - KBCHARSET => $charset, - REMOVE_MOD_META_L => "", - DISABLE_WINDOWS_KEY => $disable_windows_key, - BACKSPACE => $isNotDelete ? "BackSpace" : "Delete" }); + my $config = read_raw($prefix); + put_in_hash($config, { + KEYTABLE => keyboard2kmap($keyboard), + KBCHARSET => $charset, + }); + add2hash_($config, { + DISABLE_WINDOWS_KEY => bool2yesno(detect_devices::isLaptop()), + BACKSPACE => $isNotDelete ? "BackSpace" : "Delete", + }); + setVarsInSh("$prefix/etc/sysconfig/keyboard", %$config); run_program::rooted($prefix, "dumpkeys > /etc/sysconfig/console/default.kmap") or log::l("dumpkeys failed"); } +sub read_raw { + my ($prefix) = @_; + my %config = getVarsFromSh("$prefix/etc/sysconfig/keyboard"); + \%config; +} + sub read { my ($prefix) = @_; - my %keyf = getVarsFromSh("$prefix/etc/sysconfig/keyboard"); - my $keytable = $keyf{KEYTABLE}; - # If not yet defined in the file, check if we are a laptop: - $disable_windows_key = ($keyf{DISABLE_WINDOWS_KEY}) || (detect_devices::isLaptop() ? "yes" : "no"); + my $keytable = read_raw($prefix)->{KEYTABLE}; keyboard2kmap($_) eq $keytable and return $_ foreach keys %keyboards; $keyboards{$keytable} && $keytable; #- keep track of unknown keyboard. } |