summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-08-29 15:48:39 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-08-29 15:48:39 +0000
commitff28489c83f4ae02fd61a15f754e7be125e92183 (patch)
treee3b7d173e3f8cf852240ce91d8e027deefec333e /perl-install
parent646e82f8790af17467830c02218dfd43509b72cf (diff)
downloaddrakx-backup-do-not-use-ff28489c83f4ae02fd61a15f754e7be125e92183.tar
drakx-backup-do-not-use-ff28489c83f4ae02fd61a15f754e7be125e92183.tar.gz
drakx-backup-do-not-use-ff28489c83f4ae02fd61a15f754e7be125e92183.tar.bz2
drakx-backup-do-not-use-ff28489c83f4ae02fd61a15f754e7be125e92183.tar.xz
drakx-backup-do-not-use-ff28489c83f4ae02fd61a15f754e7be125e92183.zip
(loadkeys_files): fixed
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/keyboard.pm16
1 files changed, 12 insertions, 4 deletions
diff --git a/perl-install/keyboard.pm b/perl-install/keyboard.pm
index 463fe41cc..8ef9cadf3 100644
--- a/perl-install/keyboard.pm
+++ b/perl-install/keyboard.pm
@@ -237,22 +237,30 @@ sub keyboard2kmap { $keyboards{$_[0]} && $keyboards{$_[0]}[1] }
sub keyboard2xkb { $keyboards{$_[0]} && $keyboards{$_[0]}[2] }
sub loadkeys_files {
+ my ($warn) = @_;
my $archkbd = arch() =~ /^sparc/ ? "sun" : arch() =~ /i.86/ ? "i386" : arch() =~ /ppc/ ? "mac" : arch();
my $p = "/usr/lib/kbd/keymaps/$archkbd";
my $post = ".kmap.gz";
my %trans = ("cz-latin2" => "cz-lat2");
+ my %find_file;
+ foreach my $dir (all($p)) {
+ $find_file{$dir} = '';
+ foreach (all("$p/$dir")) {
+ $find_file{$_} && $warn and warn "file $_ is both in $find_file{$_} and $dir\n";
+ $find_file{$_} = "$p/$dir/$_";
+ }
+ }
my (@l, %l);
foreach (values %keyboards) {
local $_ = $trans{$_->[1]} || $_->[1];
- my ($l) = grep { -e $_ } ("$p/$_$post");
- $l or /(..)/ and ($l) = grep { -e $_ } ("$p/$1$post");
- print STDERR "unknown $_\n" if $_[0] && !$l; $l or next;
+ my $l = $find_file{"$_$post"} || $find_file{first(/(..)/) . $post};
+ print STDERR "unknown $_\n" if $warn && !$l; $l or next;
push @l, $l;
foreach (`zgrep include $l | grep "^include"`) {
/include\s+"(.*)"/ or die "bad line $_";
@l{grep { -e $_ } ("$p/$1.inc.gz")} = ();
}
- }
+ }
@l, keys %l, grep { -e $_ } map { "$p/$_.inc.gz" } qw(compose euro windowkeys linux-keys-bare);
}