summaryrefslogtreecommitdiffstats
path: root/move/make_live_tree_boot
diff options
context:
space:
mode:
Diffstat (limited to 'move/make_live_tree_boot')
-rwxr-xr-xmove/make_live_tree_boot35
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}} ];
}