public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpmlint] rawhide: Use C.UTF-8 locale for "English environment" if available
@ 2026-10-09  9:41 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-10-09  9:41 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/rpmlint
            Branch : rawhide
            Commit : 40d70df129f50757d1e164e30cb597d55ae28b0d
            Author : Miro Hrončok <miro@hroncok.cz>
            Date   : 2026-10-05T13:40:23+02:00
            Stats  : +54/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpmlint/c/40d70df129f50757d1e164e30cb597d55ae28b0d?branch=rawhide

            Log:
            Use C.UTF-8 locale for "English environment" if available

- Drops dependency on glibc-langpack-en
- Fixes: rhbz#2545532

This replaces commit 88cbd205c0bcfadbb7c023bb96be458b24e8ac64

---
diff --git a/1618.patch b/1618.patch
new file mode 100644
index 0000000..c29af97
--- /dev/null
+++ b/1618.patch
@@ -0,0 +1,50 @@
+From 43c5cb5ae4b19b3e3cb5701c00cfb737a2b6a04f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
+Date: Sun, 4 Oct 2026 22:37:27 +0200
+Subject: [PATCH] Use C.UTF-8 locale for "English environment" if available
+
+In Fedora, we have seen following warnings without English locale:
+
+    sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
+
+So we added a requirement for glibc-langpack-en,
+but this dependency can be avoided by using the C.utf8 locale.
+See https://bugzilla.redhat.com/2545532
+
+C.UTF-8 is available since glibc 2.35,
+https://sourceware.org/glibc/wiki/Proposals/C.UTF-8
+---
+ rpmlint/helpers.py | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/rpmlint/helpers.py b/rpmlint/helpers.py
+index 92603448d..cd7312444 100644
+--- a/rpmlint/helpers.py
++++ b/rpmlint/helpers.py
+@@ -3,12 +3,25 @@
+ from contextlib import contextmanager
+ import os
+ from shutil import get_terminal_size
++import subprocess
+ import sys
+ 
+ from rpmlint.color import Color
+ 
+ 
+-ENGLISH_ENVIRONMENT = dict(os.environ, LC_ALL='en_US.UTF-8', LANGUAGE='en_US')
++def _english_environ():
++    try:
++        cmd = ['locale', '-a']
++        locales = subprocess.check_output(cmd, text=True).splitlines()
++        locales = [locale.lower() for locale in locales]
++    except (FileNotFoundError, subprocess.CalledProcessError):
++        locales = []
++    if 'c.utf8' in locales or 'c.utf-8' in locales:
++        return dict(os.environ, LC_ALL='C.UTF-8', LANGUAGE='C')
++    return dict(os.environ, LC_ALL='en_US.UTF-8', LANGUAGE='en_US')
++
++
++ENGLISH_ENVIRONMENT = _english_environ()
+ 
+ 
+ def string_center(message, filler=' '):

diff --git a/rpmlint.spec b/rpmlint.spec
index f72096a..1b667d8 100644
--- a/rpmlint.spec
+++ b/rpmlint.spec
@@ -15,6 +15,10 @@ Source3:        scoring.toml
 Source4:        users-groups.toml
 Source5:        warn-on-functions.toml
 
+# Use C.UTF-8 locale for "English environment" if available
+# Fixes https://bugzilla.redhat.com/2545532
+Patch:          https://github.com/rpm-software-management/rpmlint/pull/1618.patch
+
 BuildArch:      noarch
 
 # use git to apply patches; it handles binary diffs
@@ -41,7 +45,6 @@ Requires:       rpm-build
 Requires:       /usr/bin/appstream-util
 Requires:       /usr/bin/desktop-file-validate
 Requires:       rpmlint-fedora-license-data
-Requires:       glibc-langpack-en
 
 %description
 rpmlint is a tool for checking common errors in RPM packages. Binary

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-09  9:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-09  9:41 [rpms/rpmlint] rawhide: Use C.UTF-8 locale for "English environment" if available 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox