summaryrefslogtreecommitdiffstats
path: root/perl-install/lang.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-12-06 21:51:26 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-12-06 21:51:26 +0000
commit33512d7f58fab6184ea1dc21930f1d00c0e382c8 (patch)
tree373d54a6623e73fe709aa22170ba0b1f4fe0cbd5 /perl-install/lang.pm
parent6f09486fa6b42c0b3fedb48d4b8dd2e6ac52c647 (diff)
downloaddrakx-33512d7f58fab6184ea1dc21930f1d00c0e382c8.tar
drakx-33512d7f58fab6184ea1dc21930f1d00c0e382c8.tar.gz
drakx-33512d7f58fab6184ea1dc21930f1d00c0e382c8.tar.bz2
drakx-33512d7f58fab6184ea1dc21930f1d00c0e382c8.tar.xz
drakx-33512d7f58fab6184ea1dc21930f1d00c0e382c8.zip
adapt to the fact that RPM_INSTALL_LANG is obsoloted. Now rpm uses %_install_langs in /etc/rpm/macros
Diffstat (limited to 'perl-install/lang.pm')
-rw-r--r--perl-install/lang.pm27
1 files changed, 15 insertions, 12 deletions
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index 78c8b954e..332f9a88c 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -276,36 +276,39 @@ sub set {
delete $ENV{LC_ALL};
delete $ENV{LINGUAGE};
delete $ENV{LINGUAS};
- delete $ENV{RPM_INSTALL_LANG};
}
}
-sub set_langs {
+sub pack_langs {
my ($l) = @_;
- $l or return;
- $ENV{RPM_INSTALL_LANG} = member('all', @$l) ? 'all' :
+ member('all', @$l) ? 'all' :
join ':', uniq(map { substr($languages{$_}[2], 0, 2) } @$l);
- log::l("RPM_INSTALL_LANG: $ENV{RPM_INSTALL_LANG}");
}
-sub get_langs {
+sub unpack_langs {
+ my ($langs) = @_;
[
- $ENV{RPM_INSTALL_LANG} eq 'all' ?
+ $langs eq 'all' ?
map { substr($_->[2], 0, 2) } values %languages :
- split(':', $ENV{RPM_INSTALL_LANG})
+ split(':', $langs)
];
}
+sub write_langs {
+ my ($prefix, $langs) = @_;
+ symlink "$prefix/etc/rpm", "/etc/rpm" if $prefix;
+ substInFile { s/%_install_langs//; $_ .= "%_install_langs $langs\n" if eof } "$prefix/etc/rpm/macros";
+}
+
sub write {
- my ($prefix) = @_;
- my $lang = $ENV{LC_ALL};
+ my ($prefix, $lang) = @_;
$lang or return;
- my $h = { RPM_INSTALL_LANG => $ENV{RPM_INSTALL_LANG} };
+ my $h = {};
$h->{$_} = $lang foreach qw(LC_COLLATE LC_CTYPE LC_MESSAGES LC_NUMERIC LC_MONETARY LC_TIME);
if (my $l = $languages{$lang}) {
- add2hash $h, { LANG => $l->[2], LANGUAGE => $l->[3], RPM_INSTALL_LANG => $l->[3] };
+ add2hash $h, { LANG => $l->[2], LANGUAGE => $l->[3] };
my $c = $charsets{$l->[1] || ''};
if ($c) {