summaryrefslogtreecommitdiffstats
path: root/perl-install/lang.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-01-05 12:00:47 +0000
committerFrancois Pons <fpons@mandriva.com>2001-01-05 12:00:47 +0000
commit1113f1a9304ef42586921f77e0eada2db25b19ea (patch)
treef2e1308133831833203749448a0a41c3bc5ca475 /perl-install/lang.pm
parent9ced370887c609cd221b798dc871dec78e8d3ee8 (diff)
downloaddrakx-1113f1a9304ef42586921f77e0eada2db25b19ea.tar
drakx-1113f1a9304ef42586921f77e0eada2db25b19ea.tar.gz
drakx-1113f1a9304ef42586921f77e0eada2db25b19ea.tar.bz2
drakx-1113f1a9304ef42586921f77e0eada2db25b19ea.tar.xz
drakx-1113f1a9304ef42586921f77e0eada2db25b19ea.zip
removed need of packdrake binary
Diffstat (limited to 'perl-install/lang.pm')
-rw-r--r--perl-install/lang.pm23
1 files changed, 19 insertions, 4 deletions
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index a282c444a..13b06b1df 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -279,9 +279,14 @@ sub set {
@ENV{qw(LANG LC_ALL LANGUAGE LINGUAS)} = ();
eval { commands::rm("-r", "$ENV{SHARE_PATH}/locale") };
- require 'run_program.pm';
- run_program::run("packdrake", "-x", "$ENV{SHARE_PATH}/locale.cz2", "$ENV{SHARE_PATH}/locale", "UTF-8");
- run_program::run("packdrake", "-x", "$ENV{SHARE_PATH}/locale.cz2", "$ENV{SHARE_PATH}/locale", $languages{$lang}[2]);
+ eval {
+ require packdrake;
+ my $packer = new packdrake("$ENV{SHARE_PATH}/locale.cz2");
+ $packer->extract_archive("$ENV{SHARE_PATH}/locale", "UTF-8", $languages{$lang}[2]);
+ };
+ #require 'run_program.pm';
+ #run_program::run("packdrake", "-x", "$ENV{SHARE_PATH}/locale.cz2", "$ENV{SHARE_PATH}/locale", "UTF-8");
+ #run_program::run("packdrake", "-x", "$ENV{SHARE_PATH}/locale.cz2", "$ENV{SHARE_PATH}/locale", $languages{$lang}[2]);
}
$ENV{LC_ALL} = $lang;
@@ -367,6 +372,7 @@ sub load_po($) {
my $f; -e ($f = "$_/po/$lang.po") and last foreach @INC;
local *F;
+ my $pid;
unless ($f && -e $f) {
-e ($f = "$_/po/$lang.po.bz2") and last foreach @INC;
if (-e $f) {
@@ -374,7 +380,14 @@ sub load_po($) {
} else {
-e ($f = "$_/po.cz2") and last foreach @INC;
log::l("trying to load $lang.po from $f");
- open F, "packdrake -x $f '' $lang.po 2>/dev/null |";
+ #open F, "packdrake -x $f '' $lang.po 2>/dev/null |";
+ unless ($pid = open F, "-|") {
+ eval {
+ require packdrake;
+ my $packer = new packdrake($f);
+ $packer->extract_archive(undef, "$lang.po");
+ };
+ }
}
} else {
open F, $f; #- not returning here help avoiding reading the same multiple times.
@@ -404,6 +417,7 @@ sub load_po($) {
$s .= ");";
no strict "vars";
eval $s;
+ $pid and waitpid $pid, 0;
!$@;
}
@@ -420,6 +434,7 @@ sub load_console_font {
my ($charset) = $languages{$lang} && $languages{$lang}[1] ;
my ($f, $u, $m) = @{$charsets{$charset} || []};
+ require run_program;
run_program::run('consolechars', '-v',
('-f', $f || 'lat0-sun16'),
$u ? ('-u', $u) : (),