Mageia Bugzilla – Attachment 10950 Details for
Bug 24671
Upgrading M6.0 official to M7 B3 round 3 does not respect current country
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Patch to cause installer/localedrake to store the country code in /etc/locale.conf
0001-Store-country-code-in-etc-locale.conf-mga-24671.patch (text/plain), 3.23 KB, created by
Martin Whitaker
on 2019-04-19 01:47:37 CEST
(
hide
)
Description:
Patch to cause installer/localedrake to store the country code in /etc/locale.conf
Filename:
MIME Type:
Creator:
Martin Whitaker
Created:
2019-04-19 01:47:37 CEST
Size:
3.23 KB
patch
obsolete
>From e9600c6d10c80b1d1e2cb275f399f69365eccc33 Mon Sep 17 00:00:00 2001 >From: Martin Whitaker <mageia@martin-whitaker.me.uk> >Date: Thu, 18 Apr 2019 21:54:15 +0100 >Subject: [PATCH 1/2] Store country code in /etc/locale.conf (mga#24671) > >This allows the installer to show the correct country when >performing an upgrade. > >diff --git a/perl-install/NEWS b/perl-install/NEWS >index fff4b3d3d..ec1987379 100644 >--- a/perl-install/NEWS >+++ b/perl-install/NEWS >@@ -1,3 +1,4 @@ >+- localedrake: store country code in /etc/locale.conf (mga#24671) > - diskdrake: fix resize of encrypted partitions (mga#22032) > > Version 18.11 - 16 March 2019 >diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS >index 121317763..c7151e368 100644 >--- a/perl-install/install/NEWS >+++ b/perl-install/install/NEWS >@@ -1,3 +1,4 @@ >+- store country code in /etc/locale.conf (mga#24671) > - don't automatically change time zone on upgrade (mga#24670) > - partitioning: fix resize of encrypted partitions (mga#22032) > >diff --git a/perl-install/lang.pm b/perl-install/lang.pm >index 9e2127d35..5097fc735 100644 >--- a/perl-install/lang.pm >+++ b/perl-install/lang.pm >@@ -1321,7 +1321,7 @@ sub pack_langs { > } > > sub system_locales_to_ourlocale { >- my ($locale_lang, $locale_country) = @_; >+ my ($locale_lang, $locale_country, $o_country) = @_; > my $locale = {}; > my $h = analyse_locale_name($locale_lang); > my $locale_lang_no_encoding = join('_', $h->{main}, if_($h->{country}, $h->{country})); >@@ -1329,7 +1329,7 @@ sub system_locales_to_ourlocale { > $locale_lang_no_encoding : #- special lang's such as en_US pt_BR > $h->{main}; > $locale->{lang} .= '@' . $h->{variant} if $h->{variant}; >- $locale->{country} = analyse_locale_name($locale_country)->{country}; >+ $locale->{country} = $o_country || analyse_locale_name($locale_country)->{country}; > $locale->{utf8} = $h->{charset} && $h->{charset} eq 'UTF-8'; > > #- safe fallbacks >@@ -1372,7 +1372,7 @@ sub read { > my %h = getVarsFromSh($b_user_only && -e $f1 ? $f1 : $f2); > # Fill in defaults (from LANG= variable) > $h{$_} ||= $h{LANG} || 'en_US' foreach @locale_conf_fields; >- my $locale = system_locales_to_ourlocale($h{LC_MESSAGES}, $h{LC_MONETARY}); >+ my $locale = system_locales_to_ourlocale($h{LC_MESSAGES}, $h{LC_MONETARY}, $h{COUNTRY}); > > if (find { $h{$_} } @IM_i18n_fields) { > my $current_IM = find { >@@ -1401,6 +1401,7 @@ sub i18n_env { > > my $h = { > XKB_IN_USE => '', >+ COUNTRY => $locale->{country}, > (map { $_ => $locale_lang } qw(LANG LC_COLLATE LC_CTYPE LC_MESSAGES LC_TIME)), > LANGUAGE => getLANGUAGE($locale->{lang}, $locale->{country}, $locale->{utf8}), > (map { $_ => $locale_country } qw(LC_NUMERIC LC_MONETARY LC_ADDRESS LC_MEASUREMENT LC_NAME LC_PAPER LC_IDENTIFICATION LC_TELEPHONE)) >@@ -1495,6 +1496,7 @@ sub write { > my @filtered_keys = grep { exists $h->{$_} && ($_ eq 'LANG' || !exists $h->{LANG} || $h->{$_} ne $h->{LANG}) } @locale_conf_fields; > my @filtered_input = grep { exists $h->{$_} } @IM_i18n_fields; > push @filtered_keys, @filtered_input; >+ push @filtered_keys, 'COUNTRY' if exists $h->{COUNTRY}; > my $h2 = { map { $_ => $h->{$_} } @filtered_keys }; > setVarsInShMode($::prefix . $file, 0644, $h2); > >-- >2.21.0 >
From e9600c6d10c80b1d1e2cb275f399f69365eccc33 Mon Sep 17 00:00:00 2001 From: Martin Whitaker <mageia@martin-whitaker.me.uk> Date: Thu, 18 Apr 2019 21:54:15 +0100 Subject: [PATCH 1/2] Store country code in /etc/locale.conf (mga#24671) This allows the installer to show the correct country when performing an upgrade. diff --git a/perl-install/NEWS b/perl-install/NEWS index fff4b3d3d..ec1987379 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,4 @@ +- localedrake: store country code in /etc/locale.conf (mga#24671) - diskdrake: fix resize of encrypted partitions (mga#22032) Version 18.11 - 16 March 2019 diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 121317763..c7151e368 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,3 +1,4 @@ +- store country code in /etc/locale.conf (mga#24671) - don't automatically change time zone on upgrade (mga#24670) - partitioning: fix resize of encrypted partitions (mga#22032) diff --git a/perl-install/lang.pm b/perl-install/lang.pm index 9e2127d35..5097fc735 100644 --- a/perl-install/lang.pm +++ b/perl-install/lang.pm @@ -1321,7 +1321,7 @@ sub pack_langs { } sub system_locales_to_ourlocale { - my ($locale_lang, $locale_country) = @_; + my ($locale_lang, $locale_country, $o_country) = @_; my $locale = {}; my $h = analyse_locale_name($locale_lang); my $locale_lang_no_encoding = join('_', $h->{main}, if_($h->{country}, $h->{country})); @@ -1329,7 +1329,7 @@ sub system_locales_to_ourlocale { $locale_lang_no_encoding : #- special lang's such as en_US pt_BR $h->{main}; $locale->{lang} .= '@' . $h->{variant} if $h->{variant}; - $locale->{country} = analyse_locale_name($locale_country)->{country}; + $locale->{country} = $o_country || analyse_locale_name($locale_country)->{country}; $locale->{utf8} = $h->{charset} && $h->{charset} eq 'UTF-8'; #- safe fallbacks @@ -1372,7 +1372,7 @@ sub read { my %h = getVarsFromSh($b_user_only && -e $f1 ? $f1 : $f2); # Fill in defaults (from LANG= variable) $h{$_} ||= $h{LANG} || 'en_US' foreach @locale_conf_fields; - my $locale = system_locales_to_ourlocale($h{LC_MESSAGES}, $h{LC_MONETARY}); + my $locale = system_locales_to_ourlocale($h{LC_MESSAGES}, $h{LC_MONETARY}, $h{COUNTRY}); if (find { $h{$_} } @IM_i18n_fields) { my $current_IM = find { @@ -1401,6 +1401,7 @@ sub i18n_env { my $h = { XKB_IN_USE => '', + COUNTRY => $locale->{country}, (map { $_ => $locale_lang } qw(LANG LC_COLLATE LC_CTYPE LC_MESSAGES LC_TIME)), LANGUAGE => getLANGUAGE($locale->{lang}, $locale->{country}, $locale->{utf8}), (map { $_ => $locale_country } qw(LC_NUMERIC LC_MONETARY LC_ADDRESS LC_MEASUREMENT LC_NAME LC_PAPER LC_IDENTIFICATION LC_TELEPHONE)) @@ -1495,6 +1496,7 @@ sub write { my @filtered_keys = grep { exists $h->{$_} && ($_ eq 'LANG' || !exists $h->{LANG} || $h->{$_} ne $h->{LANG}) } @locale_conf_fields; my @filtered_input = grep { exists $h->{$_} } @IM_i18n_fields; push @filtered_keys, @filtered_input; + push @filtered_keys, 'COUNTRY' if exists $h->{COUNTRY}; my $h2 = { map { $_ => $h->{$_} } @filtered_keys }; setVarsInShMode($::prefix . $file, 0644, $h2); -- 2.21.0
View Attachment As Raw
Actions:
View
Attachments on
bug 24671
:
10937
|
10938
| 10950 |
10951