summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/pkgs.pm10
-rw-r--r--perl-install/standalone/remove-unselected-locales13
2 files changed, 11 insertions, 12 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index e7809a048..dea3f3273 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -211,4 +211,14 @@ sub detect_unused_hardware_packages {
$do_pkgs->are_installed(@unneeded_hardware_packages);
}
+sub detect_unselected_locale_packages {
+ my ($do_pkgs) = @_;
+ require lang;
+ my $locales_prefix = 'locales-';
+ my $locale = lang::read();
+ my $selected_locale = $locales_prefix . $locale->{lang};
+ my @available_locales = $do_pkgs->are_installed($locales_prefix . '*');
+ member($selected_locale, @available_locales) ? difference2(\@available_locales, [ $selected_locale ]) : ();
+}
+
1;
diff --git a/perl-install/standalone/remove-unselected-locales b/perl-install/standalone/remove-unselected-locales
index 3d630225a..8e4eabccc 100644
--- a/perl-install/standalone/remove-unselected-locales
+++ b/perl-install/standalone/remove-unselected-locales
@@ -8,22 +8,11 @@ use do_pkgs;
use run_program;
use standalone;
-my $locales_prefix = 'locales-';
-
my $in = interactive->vnew;
-
my $wait = $in->wait_message(N("Localization packages removal"),
N("Finding unused localization packages..."));
-
my $do_pkgs = do_pkgs->do_pkgs($in);
-my $locale = lang::read();
-my $selected_locale = $locales_prefix . $locale->{lang};
-my @available_locales = $do_pkgs->are_installed($locales_prefix . '*');
-
-my @unselected_locales;
-@unselected_locales = difference2(\@available_locales, [ $selected_locale ])
- if member($selected_locale, @available_locales);
-
+my @unselected_locales = pkgs::detect_unselected_locale_packages($do_pkgs);
undef $wait;
#- we should have some gurpme