diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-06-21 14:33:49 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-06-21 14:33:49 +0000 |
commit | 83ac0232ee1253904eda352b840a206e9b4ab82f (patch) | |
tree | b2ca665cc2bc98a986c6d0f967b9ffcb6f4ba53e /move/make_live_tree_boot | |
parent | 9ce5047b17c0741cc0e10e047fce3361f6a8df87 (diff) | |
download | drakx-backup-do-not-use-83ac0232ee1253904eda352b840a206e9b4ab82f.tar drakx-backup-do-not-use-83ac0232ee1253904eda352b840a206e9b4ab82f.tar.gz drakx-backup-do-not-use-83ac0232ee1253904eda352b840a206e9b4ab82f.tar.bz2 drakx-backup-do-not-use-83ac0232ee1253904eda352b840a206e9b4ab82f.tar.xz drakx-backup-do-not-use-83ac0232ee1253904eda352b840a206e9b4ab82f.zip |
fix choosing which files to put in live_tree_always_i18n_*.clp's
Diffstat (limited to 'move/make_live_tree_boot')
-rwxr-xr-x | move/make_live_tree_boot | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/move/make_live_tree_boot b/move/make_live_tree_boot index 826604169..e7cd9d617 100755 --- a/move/make_live_tree_boot +++ b/move/make_live_tree_boot @@ -126,6 +126,18 @@ my %lists = map { $_ => [ chomp_(cat_("data/$_.list")) ]; } @clps, 'always_i18n'; +my %i18n_to_locales = do { + my %useful = map { lang::l2locale($_) => 1 } lang::list_langs(); + map_each { + if (my ($i18n) = $::a =~ /i18n_(.*)/) { + $i18n => [ map { if_(m!^/usr/share/locale/([^/]*)! && $useful{$1}, $1) } @$::b ]; + } else { + (); + } + } %lists; +}; + + $lists{always_simpl} = [ uniq(@{$lists{always}}, intersection($lists{boot}, $lists{totem})) ]; $lists{boot_simpl} = [ difference2($lists{boot}, $lists{always_simpl}) ]; $lists{totem_simpl} = [ difference2($lists{totem}, $lists{always_simpl}) ]; @@ -137,18 +149,19 @@ foreach (@clps, map { "always_i18n_$_" } @i18n) { if (!$un_build) { foreach my $i18n (@i18n) { $lists{"always_i18n_$i18n"} = [ map { - my $s = $_; - $s =~ s/__LANG__/$i18n*/; - if (my ($f) = glob("$prefix$s")) { - if (readlink($f) =~ m!^[^/]!) { - system('cp', $f, "$f-"); - rename "$f-", $f; + my $pattern = $_; + my @l = map { + (my $f = $pattern) =~ s/__LANG__/$_/; + if (readlink("$prefix$f") =~ m!^[^/]!) { + system('cp', "$prefix$f", "$prefix$f-"); + rename "$prefix$f-", "$prefix$f"; + $f; + } elsif (-e "$prefix$f") { + $f; + } else { + (); } - $f =~ s/\Q$prefix// or die "<$f> should contain $prefix\n"; - $f; - } else { - (); - } + } $i18n, @{$i18n_to_locales{$i18n}}; } @{$lists{always_i18n}} ]; } |