summaryrefslogtreecommitdiffstats
path: root/perl-install/keyboard.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-08-20 12:47:50 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-08-20 12:47:50 +0000
commit31e806378b8e95187ae6876e23c26566f0f04a4c (patch)
treeae48eb75b71735372a4cde63c1f03146f5b27b3e /perl-install/keyboard.pm
parent1c42a6faa19db4a7c01cbc900652b928a0b3d177 (diff)
downloaddrakx-backup-do-not-use-31e806378b8e95187ae6876e23c26566f0f04a4c.tar
drakx-backup-do-not-use-31e806378b8e95187ae6876e23c26566f0f04a4c.tar.gz
drakx-backup-do-not-use-31e806378b8e95187ae6876e23c26566f0f04a4c.tar.bz2
drakx-backup-do-not-use-31e806378b8e95187ae6876e23c26566f0f04a4c.tar.xz
drakx-backup-do-not-use-31e806378b8e95187ae6876e23c26566f0f04a4c.zip
- drop the loadkeys_files (it is unused)
- add more precise check of the existence of .bkmap's and that share/keymaps.tar.bz2 is up to date
Diffstat (limited to 'perl-install/keyboard.pm')
-rw-r--r--perl-install/keyboard.pm36
1 files changed, 4 insertions, 32 deletions
diff --git a/perl-install/keyboard.pm b/perl-install/keyboard.pm
index 6130f3c17..c81073282 100644
--- a/perl-install/keyboard.pm
+++ b/perl-install/keyboard.pm
@@ -300,37 +300,6 @@ sub grp_toggles {
\%grp_toggles;
}
-sub loadkeys_files {
- my ($err) = @_;
- 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{$_} and $err->("file $_ is both in $find_file{$_} and $dir") if $err;
- $find_file{$_} = "$p/$dir/$_";
- }
- }
- my (@l, %l);
- foreach (values %keyboards) {
- local $_ = $trans{$_->[1]} || $_->[1];
- my $l = $find_file{"$_$post"} || $find_file{first(/(..)/) . $post};
- if ($l) {
- push @l, $l;
- foreach (`zgrep include $l | grep "^include"`) {
- /include\s+"(.*)"/ or die "bad line $_";
- @l{grep { -e $_ } ("$p/$1.inc.gz")} = ();
- }
- } else {
- $err->("invalid loadkeys keytable $_") if $err;
- }
- }
- uniq(@l, keys %l, grep { -e $_ } map { "$p/$_.inc.gz" } qw(compose euro windowkeys linux-keys-bare));
-}
-
sub unpack_keyboards {
my ($k) = @_; $k or return;
[ grep {
@@ -508,7 +477,10 @@ sub check {
(map { (split)[2] } cat_('/usr/lib/X11/xkb/symbols.dir')));
$err->("invalid xkb layout $_") foreach difference2([ map { keyboard2xkb($_) } keyboards() ], \@xkb_layouts);
- loadkeys_files($err);
+ my @kmaps_available = map { if_(m|.*/(.*)\.bkmap|, $1) } `tar tfj share/keymaps.tar.bz2`;
+ my @kmaps_wanted = map { keyboard2kmap($_) } keyboard::keyboards();
+ $err->("missing KEYTABLE $_ (either share/keymaps.tar.bz2 need updating or $_ is bad)") foreach difference2(\@kmaps_wanted, \@kmaps_available);
+ $err->("unused KEYTABLE $_ (update share/keymaps.tar.bz2 using share/keymaps_generate)") foreach difference2(\@kmaps_available, \@kmaps_wanted);
exit($ok ? 0 : 1);
}