From 25084a9191d7f88bb4e74249ac2523a72156dc3907481be4e9bffbfc004f3c99 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 6 Sep 2023 08:18:53 +0000 Subject: [PATCH] Accepting request 1109216 from home:Andreas_Schwab:Factory - intl-c-utf-8-like-c-locale.patch: intl: Treat C.UTF-8 locale like C locale (BZ #16621) - glibc-disable-gettext-for-c-utf8.patch: Removed OBS-URL: https://build.opensuse.org/request/show/1109216 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=666 --- glibc-disable-gettext-for-c-utf8.patch | 12 -------- glibc.changes | 8 ++++++ glibc.spec | 6 ++-- intl-c-utf-8-like-c-locale.patch | 39 ++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 15 deletions(-) delete mode 100644 glibc-disable-gettext-for-c-utf8.patch create mode 100644 intl-c-utf-8-like-c-locale.patch diff --git a/glibc-disable-gettext-for-c-utf8.patch b/glibc-disable-gettext-for-c-utf8.patch deleted file mode 100644 index aab0f8a..0000000 --- a/glibc-disable-gettext-for-c-utf8.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: glibc-2.27/intl/dcigettext.c -=================================================================== ---- glibc-2.27.orig/intl/dcigettext.c -+++ glibc-2.27/intl/dcigettext.c -@@ -695,6 +695,7 @@ DCIGETTEXT (const char *domainname, cons - /* If the current locale value is C (or POSIX) we don't load a - domain. Return the MSGID. */ - if (strcmp (single_locale, "C") == 0 -+ || strcmp (single_locale, "C.UTF-8") == 0 - || strcmp (single_locale, "POSIX") == 0) - break; - diff --git a/glibc.changes b/glibc.changes index a7114dc..f0d9791 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Sep 5 11:13:13 UTC 2023 - Andreas Schwab + +- intl-c-utf-8-like-c-locale.patch: intl: Treat C.UTF-8 locale like C + locale (BZ #16621) +- glibc-disable-gettext-for-c-utf8.patch: Removed + +------------------------------------------------------------------- Mon Aug 28 11:56:10 UTC 2023 - Richard Biener - Add cross-ppc64le package diff --git a/glibc.spec b/glibc.spec index 9743132..f9d3049 100644 --- a/glibc.spec +++ b/glibc.spec @@ -287,8 +287,6 @@ Patch100: add-locales.patch Patch102: glibc-2.4.90-no_NO.diff # PATCH-FIX-OPENSUSE -- Renames for China Patch103: glibc-2.4-china.diff -# PATCH-FIX-OPENSUSE -- Disable gettext for C.UTF-8 locale -Patch104: glibc-disable-gettext-for-c-utf8.patch ### Network related patches # PATCH-FIX-OPENSUSE Warn about usage of mdns in resolv.conv @@ -307,6 +305,8 @@ Patch1001: cache-amd-legacy.patch Patch1002: cache-intel-shared.patch # PATCH-FIX-UPSTREAM malloc: Enable merging of remainders in memalign, remove bin scanning from memalign (BZ #30723) Patch1003: posix-memalign-fragmentation.patch +# PATCH-FIX-UPSTREAM intl: Treat C.UTF-8 locale like C locale (BZ #16621) +Patch1004: intl-c-utf-8-like-c-locale.patch ### # Patches awaiting upstream approval @@ -524,7 +524,6 @@ library in a cross compilation setting. %patch100 -p1 %patch102 -p1 %patch103 -p1 -%patch104 -p1 %patch304 -p1 %patch306 -p1 @@ -534,6 +533,7 @@ library in a cross compilation setting. %patch1001 -p1 %patch1002 -p1 %patch1003 -p1 +%patch1004 -p1 %endif %patch2000 -p1 diff --git a/intl-c-utf-8-like-c-locale.patch b/intl-c-utf-8-like-c-locale.patch new file mode 100644 index 0000000..ff9e1c1 --- /dev/null +++ b/intl-c-utf-8-like-c-locale.patch @@ -0,0 +1,39 @@ +From 2897b231a6b71ee17d47d3d63f1112b2641a476c Mon Sep 17 00:00:00 2001 +From: Bruno Haible +Date: Mon, 4 Sep 2023 15:31:36 +0200 +Subject: [PATCH] intl: Treat C.UTF-8 locale like C locale (BZ# 16621) + +The wiki page https://sourceware.org/glibc/wiki/Proposals/C.UTF-8 +says that "Setting LC_ALL=C.UTF-8 will ignore LANGUAGE just like it +does with LC_ALL=C." This patch implements it. + +* intl/dcigettext.c (guess_category_value): Treat C. locale +like the C locale. + +Reviewed-by: Florian Weimer +--- + intl/dcigettext.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/intl/dcigettext.c b/intl/dcigettext.c +index 7886ac9545..27063886d2 100644 +--- a/intl/dcigettext.c ++++ b/intl/dcigettext.c +@@ -1560,8 +1560,12 @@ guess_category_value (int category, const char *categoryname) + 2. The precise output of some programs in the "C" locale is specified + by POSIX and should not depend on environment variables like + "LANGUAGE" or system-dependent information. We allow such programs +- to use gettext(). */ +- if (strcmp (locale, "C") == 0) ++ to use gettext(). ++ Ignore LANGUAGE and its system-dependent analogon also if the locale is ++ set to "C.UTF-8" or, more generally, to "C.", because that's ++ the by-design behaviour for glibc, see ++ . */ ++ if (locale[0] == 'C' && (locale[1] == '\0' || locale[1] == '.')) + return locale; + + /* The highest priority value is the value of the 'LANGUAGE' environment +-- +2.42.0 +