summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-08-21 00:00:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-08-21 00:00:16 +0000
commita863a436fc7313fd4b4d876540fe3d41902123a5 (patch)
treec8d960df3359e6414f6a83c7b4a6bba6fb5ea50c /perl-install
parent7340d5d9bdf6b8ae8a020fcb1f6a8d4e56eb5c8d (diff)
downloaddrakx-a863a436fc7313fd4b4d876540fe3d41902123a5.tar
drakx-a863a436fc7313fd4b4d876540fe3d41902123a5.tar.gz
drakx-a863a436fc7313fd4b4d876540fe3d41902123a5.tar.bz2
drakx-a863a436fc7313fd4b4d876540fe3d41902123a5.tar.xz
drakx-a863a436fc7313fd4b4d876540fe3d41902123a5.zip
put back loadkeys_files which *is* used (by make_rescue_img)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/keyboard.pm33
1 files changed, 33 insertions, 0 deletions
diff --git a/perl-install/keyboard.pm b/perl-install/keyboard.pm
index dc5d74ae3..8d8797ee2 100644
--- a/perl-install/keyboard.pm
+++ b/perl-install/keyboard.pm
@@ -320,6 +320,37 @@ 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 {
@@ -502,6 +533,8 @@ sub check {
$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);
+ loadkeys_files($err);
+
exit($ok ? 0 : 1);
}