summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/NEWS2
-rw-r--r--perl-install/any.pm2
-rwxr-xr-xperl-install/c/stuff.xs.pl11
-rw-r--r--perl-install/common.pm21
-rw-r--r--perl-install/install/NEWS2
-rw-r--r--perl-install/install/gtk.pm2
-rw-r--r--perl-install/install/steps_gtk.pm2
-rw-r--r--perl-install/lang.pm2
-rw-r--r--perl-install/standalone.pm2
9 files changed, 27 insertions, 19 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 22339bd87..08ebc99d0 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,5 @@
+- use POSIX::setlocale() instead of c::setlocale() to ensure Locale::gettext
+ uses any locale changes we make (mga#34656)
- use task-plasma-minimal instead of task-plasma5-minimal
- fix bugs in any::sessions() (mga#33738)
diff --git a/perl-install/any.pm b/perl-install/any.pm
index ab93036dc..dc0d112e1 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -1450,7 +1450,7 @@ sub selectLanguage_standalone {
]);
$locale->{utf8} = !$non_utf8;
lang::set($locale);
- c::init_setlocale() if $in->isa('interactive::gtk');
+ common::init_setlocale() if $in->isa('interactive::gtk');
lang::lang_changed($locale) if $old_lang ne $locale->{lang};
}
diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl
index 1a148b497..8c780bb2a 100755
--- a/perl-install/c/stuff.xs.pl
+++ b/perl-install/c/stuff.xs.pl
@@ -189,17 +189,6 @@ is_secure_file(filename)
OUTPUT:
RETVAL
-void
-init_setlocale()
- CODE:
- setlocale(LC_ALL, "");
- setlocale(LC_NUMERIC, "C"); /* otherwise eval "1.5" returns 1 in fr_FR for example */
-
-char *
-setlocale(category, locale = NULL)
- int category
- char * locale
-
int
lseek_sector(fd, sector, offset)
int fd
diff --git a/perl-install/common.pm b/perl-install/common.pm
index 508e6b31f..23ae4ea6f 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -7,10 +7,11 @@ BEGIN { eval { require Locale::gettext } } #- allow common.pm to be used in drak
use log;
use run_program;
+use POSIX qw(locale_h);
use Exporter;
our @ISA = qw(Exporter);
-our @EXPORT = qw($SECTORSIZE N P N_ check_for_xserver files_exist formatTime MB formatXiB get_libdir get_parent_uid is_running is_uefi kernel_uefi_type makedev mageia_release mageia_release_info mount_efivars removeXiBSuffix require_root_capability setVirtual set_alternative set_l10n_sort set_permissions to_utf8 translate uefi_type unmakedev);
+our @EXPORT = qw($SECTORSIZE N P N_ check_for_xserver files_exist formatTime MB formatXiB get_libdir get_parent_uid init_setlocale is_running is_uefi kernel_uefi_type makedev mageia_release mageia_release_info mount_efivars removeXiBSuffix require_root_capability setVirtual set_alternative set_l10n_sort set_permissions to_utf8 translate uefi_type unmakedev);
# perl_checker: RE-EXPORT-ALL
push @EXPORT, @MDK::Common::EXPORT;
@@ -34,6 +35,20 @@ our $SECTORSIZE = 512;
=over
+=item init_setlocale()
+
+Initialise all locale categories. Set LC_NUMERIC to 'C' (otherwise eval "1.5" returns 1
+in fr_FR for example). Set all other categories according to the current value of the
+LC_ALL environment variable, or if that is undefined, the LANG environment variable, or
+if that is undefined, the system default.
+
+=cut
+
+sub init_setlocale() {
+ setlocale(LC_ALL, '');
+ setlocale(LC_NUMERIC, 'C');
+}
+
=item N($format, ...)
translate a message by calling gettext(). eg:
@@ -171,8 +186,8 @@ only LC_COLLATE will have no effect.
sub set_l10n_sort() {
my $collation_locale = $ENV{LC_ALL};
if (!$collation_locale) {
- $collation_locale = c::setlocale(c::LC_COLLATE());
- $collation_locale =~ /UTF-8/ or c::setlocale(c::LC_COLLATE(), "$collation_locale.UTF-8");
+ $collation_locale = setlocale(LC_COLLATE);
+ $collation_locale =~ /UTF-8/ or setlocale(LC_COLLATE, "$collation_locale.UTF-8");
}
}
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 9a6552f2a..912b1cd1b 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,3 +1,5 @@
+- use POSIX::setlocale() instead of c::setlocale() to ensure Locale::gettext
+ uses any locale changes we make (mga#34656)
- use task-plasma-minimal instead of task-plasma5-minimal
- use mutter with X11 backend
- Create /etc while creating installer system
diff --git a/perl-install/install/gtk.pm b/perl-install/install/gtk.pm
index f878e42d9..a6aad8516 100644
--- a/perl-install/install/gtk.pm
+++ b/perl-install/install/gtk.pm
@@ -212,7 +212,7 @@ q(<fontconfig>
}
Gtk3->init;
- c::init_setlocale();
+ common::init_setlocale();
}
#------------------------------------------------------------------------------
diff --git a/perl-install/install/steps_gtk.pm b/perl-install/install/steps_gtk.pm
index fa34c947c..a9ef359be 100644
--- a/perl-install/install/steps_gtk.pm
+++ b/perl-install/install/steps_gtk.pm
@@ -186,7 +186,7 @@ sub leavingStep {
sub charsetChanged {
my ($o) = @_;
- c::init_setlocale();
+ common::init_setlocale();
install::gtk::load_font($o);
install::gtk::create_steps_window($o);
}
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index a3c8aa7ea..5301bd1f3 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -1612,7 +1612,7 @@ sub bindtextdomain() {
#- NB: not using $::isInstall to make it work more easily at install and standalone
my $localedir = "$ENV{SHARE_PATH}/locale" . ($::prefix ? "_special" : '');
- c::init_setlocale();
+ common::init_setlocale();
foreach (@::textdomains, 'libDrakX') {
Locale::gettext::bind_textdomain_codeset($_, 'UTF-8');
Locale::gettext::bindtextdomain($_, $localedir);
diff --git a/perl-install/standalone.pm b/perl-install/standalone.pm
index 806ebf7cd..4b14255d0 100644
--- a/perl-install/standalone.pm
+++ b/perl-install/standalone.pm
@@ -20,7 +20,7 @@ $::isStandalone = 1;
$ENV{SHARE_PATH} ||= "/usr/share";
eval { #- allow standalone.pm to be used in drakxtools-backend without perl-Locale-gettext
- c::init_setlocale();
+ common::init_setlocale();
Locale::gettext::bindtextdomain('libDrakX', "/usr/share/locale");
};