From 7db5765e222c6d84bfe33dd7258c8ffe61d4be12 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 9 Aug 2005 07:06:19 +0000 Subject: create lang::write_and_install() which takes a $do_pkgs --- perl-install/install_steps.pm | 2 +- perl-install/install_steps_interactive.pm | 2 +- perl-install/lang.pm | 28 +++++++++++----------------- perl-install/standalone/finish-install | 2 +- perl-install/standalone/localedrake | 16 ++++++++++++++-- 5 files changed, 28 insertions(+), 22 deletions(-) diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index b586ea3ed..0afb51383 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -129,7 +129,7 @@ sub selectLanguage { lang::write_langs($o->{locale}{langs}); } 'formatPartitions'; addToBeDone { - lang::write($o->{locale}); + lang::write_and_install($o->{locale}, $o->do_pkgs); } 'installPackages'; } #------------------------------------------------------------------------------ diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index 560f5feb9..2e1f9f762 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -959,7 +959,7 @@ sub summary { my @pkgs = pkgs::packagesProviding($o->{packages}, "locales-$pkg_locale"); $o->pkg_install(map { $_->name } @pkgs) if @pkgs; - lang::write($o->{locale}); + lang::write_and_install($o->{locale}, $o->do_pkgs); if (!$timezone_manually_set) { delete $o->{timezone}; install_any::preConfigureTimezone($o); #- now we can precise the timezone thanks to the country diff --git a/perl-install/lang.pm b/perl-install/lang.pm index 18de34037..bc6d77d76 100644 --- a/perl-install/lang.pm +++ b/perl-install/lang.pm @@ -1007,6 +1007,17 @@ sub i18n_env { $h; } +sub write_and_install { + my ($locale, $do_pkgs, $b_user_only, $b_dont_touch_kde_files) = @_; + + my @packages = IM2packages($locale); + if (@packages && !$b_user_only) { + log::explanations("Installing IM packages: ", join(', ', @packages)); + $do_pkgs->install(@packages); + } + &write($locale, $b_user_only, $b_dont_touch_kde_files); +} + sub write { my ($locale, $b_user_only, $b_dont_touch_kde_files) = @_; @@ -1062,23 +1073,6 @@ sub write { $h->{XIM_PROGRAM}{$locale->{lang}} || $h->{XIM_PROGRAM}{getlocale_for_country($locale->{lang}, $locale->{country})}; } - - my @packages = IM2packages($locale); - if (@packages && $b_user_only) { - require interactive; - interactive->vnew->ask_warn(N("Warning"), - N("You should install the following packages: %s", - join( - #-PO: the following is used to combine packages names. eg: "initscripts, harddrake, yudit" - N(", "), - @packages, - ), - ) - ); - } elsif (@packages) { - log::explanations("Installing IM packages: ", join(', ', @packages)); - do_pkgs_standalone->new->install(@packages); - } } #- deactivate translations on console for most CJK, RTL and complex languages diff --git a/perl-install/standalone/finish-install b/perl-install/standalone/finish-install index ac904f8ff..215756a7e 100755 --- a/perl-install/standalone/finish-install +++ b/perl-install/standalone/finish-install @@ -23,7 +23,7 @@ sub ask_language() { require lang; my $locale = lang::read(); any::selectLanguage_and_more_standalone($in, $locale); - lang::write($locale); + lang::write_and_install($locale, $in->do_pkgs); lang::set($locale); Gtk2->set_locale; } diff --git a/perl-install/standalone/localedrake b/perl-install/standalone/localedrake index 3c379c763..c3e07093b 100644 --- a/perl-install/standalone/localedrake +++ b/perl-install/standalone/localedrake @@ -24,7 +24,7 @@ if (defined $klang) { my $locale = lang::read($>); $klang and $locale->{lang} = $lang; $kcountry and $locale->{country} = $country; - lang::write($locale, $>, 'dont_touch_kde_files') if $apply; + lang::write_and_install($locale, do_pkgs_standalone->new, $>, 'dont_touch_kde_files') if $apply; #- help KDE defaulting to the right charset print lang::charset2kde_charset(lang::l2charset($lang)), "\n"; @@ -38,7 +38,19 @@ $ugtk2::wm_icon = "localedrake"; $::Wizard_title = N("LocaleDrake"); any::selectLanguage_and_more_standalone($in, $locale); -lang::write($locale, $>); + +if ($> && lang::IM2packages($locale)) { + $in->ask_warn(N("Warning"), + N("You should install the following packages: %s", + join( + #-PO: the following is used to combine packages names. eg: "initscripts, harddrake, yudit" + N(", "), + lang::IM2packages($locale) + ), + ) + ); +} +lang::write_and_install($locale, $in->do_pkgs, $>); my $msg = N("The change is done, but to be effective you must logout"); if (my $wm = $> && any::running_window_manager()) { -- cgit v1.2.1