summaryrefslogtreecommitdiffstats
path: root/perl-install/timezone.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-01-06 16:27:40 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-01-06 16:27:40 +0000
commit5c3f880e202d0b2d4c3b03236a38c35192653f91 (patch)
tree2b92e19e39a45caf4fce0520e4c65af101344ef1 /perl-install/timezone.pm
parent17e5105b9f0fbc63c48ff12b1d7c1ec378960b18 (diff)
downloaddrakx-backup-do-not-use-5c3f880e202d0b2d4c3b03236a38c35192653f91.tar
drakx-backup-do-not-use-5c3f880e202d0b2d4c3b03236a38c35192653f91.tar.gz
drakx-backup-do-not-use-5c3f880e202d0b2d4c3b03236a38c35192653f91.tar.bz2
drakx-backup-do-not-use-5c3f880e202d0b2d4c3b03236a38c35192653f91.tar.xz
drakx-backup-do-not-use-5c3f880e202d0b2d4c3b03236a38c35192653f91.zip
use $::prefix
Diffstat (limited to 'perl-install/timezone.pm')
-rw-r--r--perl-install/timezone.pm19
1 files changed, 9 insertions, 10 deletions
diff --git a/perl-install/timezone.pm b/perl-install/timezone.pm
index a070da66e..69af76e60 100644
--- a/perl-install/timezone.pm
+++ b/perl-install/timezone.pm
@@ -7,9 +7,8 @@ use common;
use log;
-sub getTimeZones {
- my ($prefix) = @_;
- $::testing and $prefix = '';
+sub getTimeZones() {
+ my $prefix = $::testing ? '' : $::prefix;
open(my $F, "cd $prefix/usr/share/zoneinfo && find [A-Z]* -type f |");
my @l = difference2([ chomp_(<$F>) ], [ 'ROC', 'PRC' ]);
close $F or die "cannot list the available zoneinfos";
@@ -23,9 +22,9 @@ sub read() {
sub ntp_server {
my $setting = @_ > 1;
- my ($prefix, $server) = @_;
+ my ($server) = @_;
- my $f = "$prefix/etc/ntp.conf";
+ my $f = "$::prefix/etc/ntp.conf";
-e $f or return;
if ($setting) {
@@ -36,7 +35,7 @@ sub ntp_server {
$added = 1;
}
} $f;
- output_p("$prefix/etc/ntp/step-tickers", "$server\n");
+ output_p("$::prefix/etc/ntp/step-tickers", "$server\n");
} else {
$server = find { $_ ne '127.127.1.0' } map { if_(/^\s*server\s+(\S*)/, $1) } cat_($f);
}
@@ -44,13 +43,13 @@ sub ntp_server {
}
sub write {
- my ($prefix, $t) = @_;
+ my ($t) = @_;
- ntp_server($prefix, $t->{ntp});
+ ntp_server($t->{ntp});
- eval { cp_af("$prefix/usr/share/zoneinfo/$t->{timezone}", "$prefix/etc/localtime") };
+ eval { cp_af("$::prefix/usr/share/zoneinfo/$t->{timezone}", "$::prefix/etc/localtime") };
$@ and log::l("installing /etc/localtime failed");
- setVarsInSh("$prefix/etc/sysconfig/clock", {
+ setVarsInSh("$::prefix/etc/sysconfig/clock", {
ZONE => $t->{timezone},
UTC => bool2text($t->{UTC}),
ARC => "false",