summaryrefslogtreecommitdiffstats
path: root/perl-install/install/share/kmap2bkmap
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-05-23 18:25:34 +0000
committerThierry Vignaud <tv@mageia.org>2012-05-23 18:25:34 +0000
commit5b0d47b829aaa15c234ce067b5eefc2e8dbd9779 (patch)
tree9a79dd375a3b43f4568ec1c553c05cf86da0aa52 /perl-install/install/share/kmap2bkmap
parented274a7235cc943ccc69543b9972544e9b2ecd57 (diff)
downloaddrakx-5b0d47b829aaa15c234ce067b5eefc2e8dbd9779.tar
drakx-5b0d47b829aaa15c234ce067b5eefc2e8dbd9779.tar.gz
drakx-5b0d47b829aaa15c234ce067b5eefc2e8dbd9779.tar.bz2
drakx-5b0d47b829aaa15c234ce067b5eefc2e8dbd9779.tar.xz
drakx-5b0d47b829aaa15c234ce067b5eefc2e8dbd9779.zip
perl_checker cleanups
Diffstat (limited to 'perl-install/install/share/kmap2bkmap')
-rwxr-xr-xperl-install/install/share/kmap2bkmap13
1 files changed, 8 insertions, 5 deletions
diff --git a/perl-install/install/share/kmap2bkmap b/perl-install/install/share/kmap2bkmap
index 8ac8f5846..9870ef3ef 100755
--- a/perl-install/install/share/kmap2bkmap
+++ b/perl-install/install/share/kmap2bkmap
@@ -8,10 +8,12 @@ my $KMAP_MAGIC = 0x8B39C07F;
BEGIN { @ARGV == 1 or die "usage: kmap2bkmap <keymap>\n" }
# load unicode keymap
-my $unimap = "$ARGV[0]" . ".uni";
+my $unimap = $ARGV[0] . ".uni";
system("sudo loadkeys $unimap") == 0 or die;
-open F, "dumpkeys -n -f |";
-<F> =~ /^keymaps\s+(.*)/ or die;
+open my $F, "dumpkeys -n -f |";
+<$F> =~ /^keymaps\s+(.*)/ or die;
+
+my @keymaps;
foreach (split ',', $1) {
my @l = /(\d+)-(\d+)/;
my ($i, $j) = @l ? @l : ($_,$_);
@@ -21,14 +23,15 @@ foreach (split ',', $1) {
print pack("I", $KMAP_MAGIC);
print map { pack "i", $keymaps[$_] || 0 } 0 .. c::MAX_NR_KEYMAPS()-1;
-foreach (<F>) {
+my @L;
+foreach (<$F>) {
s/\+0x/0x/g;
my ($keycode, $key, undef, @l) = split;
$keycode eq 'keycode' or next;
my $i = 0;
$L[$i++][$key] = hex $_ foreach @l;
}
-close F or die "dumpkeys failed";
+close $F or die "dumpkeys failed";
foreach (@L) {
foreach my $i (0 .. c::NR_KEYS()-1) {