From 4cd217c05ea6fbb9e9269fdd202bafe4d190c29a Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sun, 26 Oct 2014 09:05:04 +0100 Subject: fix selecting of uneeded locales (mga#3723) original fix by Pablo Saratxaga Mageia has he ability to choose both *language* and *country* Language is used for choosing translations to be displayed, etc. country for things like currency, etc. (country may be deduced from other geographical settings rather than choosen directly, but that is not the problem). GNU libc locales embedd both concepts (language and country) in a single locale. Obviously those exists for only some combinations. For cases were an existing matching locale doesn't exists, Mageia chooses two locales, one for the language oriented settings, and another four the country oriented settings. Unlike normal installer where packages to be installed are choosen; in draklive-install, we have a set of "all packages", and "uneeded" ones are removed. The problem was obviously the installer didn't see the "need" for the locales-xx package for country; only language was checked. This fixes that, the idea is to check for *both* $locale->{lang} and $locale->{country}, which can lead two *two* neeeded locales-xx packages --- perl-install/install/NEWS | 1 + perl-install/pkgs.pm | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 5ff5595fc..244b2b5cd 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,5 +1,6 @@ - drakx-in-chroot: o pre-create /dev/null & co again (for draklive) +- fix selecting of uneeded locales (mga#3723) Version 16.44 - 23 October 2014 diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 6fbf00ed7..afc5cc784 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -242,9 +242,10 @@ sub detect_unselected_locale_packages { require lang; my $locales_prefix = 'locales-'; my $locale = lang::read(); - my $selected_locale = $locales_prefix . lang::locale_to_main_locale($locale->{lang}); + my @selected_locales = map { $locales_prefix . $_ } lang::locale_to_main_locale($locale->{lang}), lang::c2locale($locale->{country}); my @available_locales = $do_pkgs->are_installed($locales_prefix . '*'); - member($selected_locale, @available_locales) ? difference2(\@available_locales, [ $selected_locale ]) : (); + my @unneeded_locales = difference2(\@available_locales, \@selected_locales); + $do_pkgs->are_installed(@unneeded_locales); } sub remove_unused_packages { -- cgit v1.2.1