summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-09-10 16:02:13 +0000
committerOlivier Blin <oblin@mandriva.com>2008-09-10 16:02:13 +0000
commit1db729772f0612c1810956632318cd79e190651b (patch)
tree578bce76faccd097effd0335721aa9a9ba652a1b /perl-install/standalone
parenta499c29545a2b31071b0e9350dc61d6044de9265 (diff)
downloaddrakx-1db729772f0612c1810956632318cd79e190651b.tar
drakx-1db729772f0612c1810956632318cd79e190651b.tar.gz
drakx-1db729772f0612c1810956632318cd79e190651b.tar.bz2
drakx-1db729772f0612c1810956632318cd79e190651b.tar.xz
drakx-1db729772f0612c1810956632318cd79e190651b.zip
guess country from timezone when possible (#23303)
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-xperl-install/standalone/finish-install10
1 files changed, 10 insertions, 0 deletions
diff --git a/perl-install/standalone/finish-install b/perl-install/standalone/finish-install
index f7d100201..b7d98ae3d 100755
--- a/perl-install/standalone/finish-install
+++ b/perl-install/standalone/finish-install
@@ -78,6 +78,16 @@ sub ask_timezone() {
sub ask_country() {
require lang;
$locale ||= lang::read();
+ require Time::ZoneInfo;
+ my $zones = Time::ZoneInfo->new;
+ if ($timezone && $zones) {
+ #- guess only if timezone has been asked already
+ if (my $zone = $zones->current_zone) {
+ if (my $country_code = $zones->country($zone)) {
+ $locale->{country} = $country_code;
+ }
+ }
+ }
any::selectCountry($in, $locale);
lang::write_and_install($locale, $in->do_pkgs);
}