summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-02-28 13:55:00 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-02-28 13:55:00 +0000
commite05ffeeb6e6315329d236e1575c53113229eb754 (patch)
tree4866f1a15dd66133c98b98ba831f8420599fc084
parent3cdeff7ad3904a853c78bab4c4ea0c5424d96755 (diff)
downloaddrakx-backup-do-not-use-e05ffeeb6e6315329d236e1575c53113229eb754.tar
drakx-backup-do-not-use-e05ffeeb6e6315329d236e1575c53113229eb754.tar.gz
drakx-backup-do-not-use-e05ffeeb6e6315329d236e1575c53113229eb754.tar.bz2
drakx-backup-do-not-use-e05ffeeb6e6315329d236e1575c53113229eb754.tar.xz
drakx-backup-do-not-use-e05ffeeb6e6315329d236e1575c53113229eb754.zip
resolve conflicts for short keytable names (eg: "no" could be either "no-dvorak" or "no-latin1")
-rwxr-xr-xrescue/make_rescue_img13
1 files changed, 11 insertions, 2 deletions
diff --git a/rescue/make_rescue_img b/rescue/make_rescue_img
index 30096a91b..87ea8f870 100755
--- a/rescue/make_rescue_img
+++ b/rescue/make_rescue_img
@@ -62,9 +62,18 @@ _ "find $tmp -name 'CVS*' | xargs rm -rf";
_ "perl devices.pl $tmp/dev";
install_raw(keyboard::loadkeys_files());
+my %keytable_conflicts;
+my @less_important_keytables = qw(am_old am_phonetic no-dvorak fr_CH-latin1);
foreach (keyboard::loadkeys_files()) {
- # create the long name based on the short one (if needed)
- symlink "$2.kmap.gz", "$tmp$1/$3.kmap.gz" if m|(.*)/((..).+)\.kmap\.gz|;
+ my ($dir, $fname) = (dirname($_), basename($_));
+ my ($name) = $fname =~ /(.*)\.kmap\.gz/ or next;
+ next if member($name, @less_important_keytables);
+ if (my ($short) = $name =~ m|(.+?)[\W_]|) {
+ $keytable_conflicts{$short} and warn("conflict between $keytable_conflicts{$short} and $name for short name $short (choosing the first)\n"), next;
+ $keytable_conflicts{$short} = $name;
+ # create the short name based on the long one
+ symlinkf($fname, "$tmp$dir/$short.kmap.gz");
+ }
}
my $perl_version = join ".", unpack "C3", $^V;