summaryrefslogtreecommitdiffstats
path: root/move/data/make_i18n_list
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-05-11 23:25:06 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-05-11 23:25:06 +0000
commit91df9b8e124bf3c35e69b0e01fa96727fc4372c8 (patch)
treeb279c395b8387b1c4e98f8e90867bd06e9bf46eb /move/data/make_i18n_list
parent4ceadc161411734859708e2828f9b106dc5e6b6f (diff)
downloaddrakx-91df9b8e124bf3c35e69b0e01fa96727fc4372c8.tar
drakx-91df9b8e124bf3c35e69b0e01fa96727fc4372c8.tar.gz
drakx-91df9b8e124bf3c35e69b0e01fa96727fc4372c8.tar.bz2
drakx-91df9b8e124bf3c35e69b0e01fa96727fc4372c8.tar.xz
drakx-91df9b8e124bf3c35e69b0e01fa96727fc4372c8.zip
- make_i18n_list builds the various i18n_XX.list
- make_live_tree_boot now uses them to have a new live_tree_i18n_XX containing non always busy files for lang XX. We now handle all langs
Diffstat (limited to 'move/data/make_i18n_list')
-rwxr-xr-xmove/data/make_i18n_list34
1 files changed, 34 insertions, 0 deletions
diff --git a/move/data/make_i18n_list b/move/data/make_i18n_list
new file mode 100755
index 000000000..f4c10ebaa
--- /dev/null
+++ b/move/data/make_i18n_list
@@ -0,0 +1,34 @@
+#!/usr/bin/perl
+
+use MDK::Common;
+
+my $prefix = $ARGV[0];
+my $rpm = "rpm --root $prefix";
+
+unlink glob("i18n_*.list");
+
+my %have;
+foreach my $list (glob("*.list")) {
+ $have{$_} = $list foreach chomp_(cat_($list));
+}
+
+my @pkg_langs = map { /locales-(.*)/ } `$rpm -qa --qf "%{name}\n" locales-*`;
+
+foreach my $i18n (@pkg_langs) {
+ #- $i18n_re is different from $i18n because of things like locales-no giving nb|nn|no
+ my $i18n_re = join('|', uniq($i18n, map { if_(/locales-(\S+)/, $1) } `$rpm -q --provides locales-$i18n`));
+
+ my @pkgs = uniq("locales-$i18n", chomp_(`$rpm -q --qf "%{name}\n" --whatrequires locales-$i18n`));
+ my ($dirs, $files) = partition { -d "$prefix$_" } uniq(chomp_(`$rpm -ql @pkgs`));
+
+ my @i18n_dirs = uniq(grep { m!/($i18n_re) (_[^/]*)? (\.[^/]*)? (\@[^/]*)?$!x } @$dirs);
+ my $i18n_dirs_re = join('|', map { quotemeta $_ } @i18n_dirs);
+ my @files = grep { !m!^($i18n_dirs_re)/! } @$files;
+
+ my $list = "i18n_$i18n.list";
+ foreach (@i18n_dirs, @files) {
+ $have{$_} and die "$_ would be twice: in $have{$_} and $list\n";
+ $have{$_} = $list;
+ }
+ output($list, map { "$_\n" } @i18n_dirs, @files);
+}