summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2002-06-10 12:42:26 +0000
committerDaouda Lo <daouda@mandriva.com>2002-06-10 12:42:26 +0000
commitfe986507167101d7fb0c31100f52de65e80ec4f4 (patch)
tree72fcaa7d1e298cae3d06570d9bc196645a97cdfa
parentaf6a12a52e0905d3b329b7c32edc5a248c6d0461 (diff)
downloaddrakx-fe986507167101d7fb0c31100f52de65e80ec4f4.tar
drakx-fe986507167101d7fb0c31100f52de65e80ec4f4.tar.gz
drakx-fe986507167101d7fb0c31100f52de65e80ec4f4.tar.bz2
drakx-fe986507167101d7fb0c31100f52de65e80ec4f4.tar.xz
drakx-fe986507167101d7fb0c31100f52de65e80ec4f4.zip
- choose country according to timezone.
-rw-r--r--perl-install/network/tools.pm21
1 files changed, 20 insertions, 1 deletions
diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm
index 731bd58da..ccc492395 100644
--- a/perl-install/network/tools.pm
+++ b/perl-install/network/tools.pm
@@ -5,6 +5,7 @@ use run_program;
use c;
use vars qw(@ISA @EXPORT);
use MDK::Common::Globals "network", qw($in $prefix $disconnect_file $connect_prog $connect_file);
+use MDK::Common::System qw(getVarsFromSh);
@ISA = qw(Exporter);
@EXPORT = qw(write_cnx_script write_secret_backend write_initscript ask_connect_now connect_backend disconnect_backend read_providers_backend ask_info2 type2interface connected connected_bg connected2 disconnected);
@@ -91,7 +92,7 @@ sub ask_info2 {
if__($cnx->{phone_out}, { label => _("Provider phone number"), val => \$cnx->{phone_out} }),
if__($netc->{dnsServer2}, { label => _("Provider dns 1 (optional)"), val => \$netc->{dnsServer2} }),
if__($netc->{dnsServer3}, { label => _("Provider dns 2 (optional)"), val => \$netc->{dnsServer3} }),
- if__($cnx->{vpivci}, { label => _("Choose your country"), val => \$netc->{vpivci}, list => ['Netherlands', 'France', 'Belgium', 'Italy', 'UK', 'USA'] }),
+ if__($cnx->{vpivci}, { label => _("Choose your country"), val => \$netc->{vpivci}, list => detect_timezone() }),
if__($cnx->{dialing_mode}, { label => _("Dialing mode"), val => \$cnx->{dialing_mode},list=>["auto","manual"]}),
if__($cnx->{speed}, { label => _("Connection speed"), val => \$cnx->{speed}, list => ["64 Kb/s", "128 Kb/s"]}),
if__($cnx->{huptimeout}, { label => _("Connection timeout (in sec)"), val => \$cnx->{huptimeout} }),
@@ -107,6 +108,24 @@ sub ask_info2 {
1;
}
+sub detect_timezone {
+ my %tmz2country = (
+ 'Europe/Paris' => _("France"),
+ 'Europe/Amsterdam' => _("Netherlands"),
+ 'Europe/Rome' => _("Italy"),
+ 'Europe/Brussels' => _("Belgium"),
+ 'America/New_York' => _("United States"),
+ 'Europe/London' => _("United Kingdom")
+ );
+ my %tm_parse = MDK::Common::System::getVarsFromSh('/etc/sysconfig/clock');
+ foreach (keys %tmz2country) {
+ if ($_ eq $tm_parse{ZONE}) {
+ unshift @country, $tmz2country{$_};
+ } else { push @country, $tmz2country{$_} };
+ }
+ \@country;
+}
+
sub type2interface {
my ($i) = @_;
$i=~/$_->[0]/ and return $_->[1] foreach (