public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/rpmlint] rawhide: Use C.UTF-8 locale for "English environment" if available
Date: Fri, 09 Oct 2026 09:41:04 GMT	[thread overview]
Message-ID: <179153886475.1.7471658618278157760.rpms-rpmlint-40d70df129f5@fedoraproject.org> (raw)

            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

                 reply	other threads:[~2026-10-09  9:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179153886475.1.7471658618278157760.rpms-rpmlint-40d70df129f5@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox