From 3d9b5fe42743e6d935840204f97191369cd476fc Mon Sep 17 00:00:00 2001 From: Kerin Millar Date: Sun, 4 Jan 2026 05:20:34 +0000 Subject: [PATCH 1/2] sys-apps/locale-gen: add 3.9-r2 for SELinux fix This contains a hotfix for bug #968318. The reason for not yet issuing a new release is that some additional work is required. As such, I did not want to delay the resolution of the bug in question. [sam: Tweak commit summary slightly to match our formatting.] Closes: https://bugs.gentoo.org/968318 Signed-off-by: Kerin Millar Signed-off-by: Sam James --- ...3.9-avoid-chcon-execution-if-missing.patch | 43 +++++++++++++++++++ ...3.9-r1.ebuild => locale-gen-3.9-r2.ebuild} | 1 + 2 files changed, 44 insertions(+) create mode 100644 sys-apps/locale-gen/files/3.9-avoid-chcon-execution-if-missing.patch rename sys-apps/locale-gen/{locale-gen-3.9-r1.ebuild => locale-gen-3.9-r2.ebuild} (96%) diff --git a/sys-apps/locale-gen/files/3.9-avoid-chcon-execution-if-missing.patch b/sys-apps/locale-gen/files/3.9-avoid-chcon-execution-if-missing.patch new file mode 100644 index 0000000000000..10426db8a28b2 --- /dev/null +++ b/sys-apps/locale-gen/files/3.9-avoid-chcon-execution-if-missing.patch @@ -0,0 +1,43 @@ +From ae0a37058a89a9ce9a99562931777f0636108c50 Mon Sep 17 00:00:00 2001 +From: Kerin Millar +Date: Sun, 4 Jan 2026 04:49:31 +0000 +Subject: [PATCH] Refrain from trying to execute chcon(1), if missing + +As of coreutils 9.9, the --with-selinux option is required for the +chcon(1) utility to be installed. Consider a scenario in which a Gentoo +Linux installation is being performed from an SELinux-enabled operating +environment. In that case, locale-gen(8) will detect that security +labels are supported and attempt to execute the chcon(1) utility. Given +that there is no longer any guarantee of the utility being available, +locale-gen(8) may raise the following error. + +sh: line 1: chcon: command not found +locale-gen: Aborting because the execution of 'chcon' was unsuccessful + +Address this issue by requiring for "chcon" to exist as an executable in +PATH as an additional condition for its execution, as is already the +case for "restorecon". + +Closes: https://bugs.gentoo.org/968318 +Link: https://cgit.git.savannah.gnu.org/cgit/coreutils.git/commit/?id=8ba47d09a33f0740e071a8394f3504e0fb57948e +Signed-off-by: Kerin Millar +--- + locale-gen | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/locale-gen b/locale-gen +index a65b99a..d39519f 100644 +--- a/locale-gen ++++ b/locale-gen +@@ -573,7 +573,7 @@ sub install_archive ($src_path, $dst_path, $may_reset_labels) { + run('mv', '--', $src_path, $interim_path); + + # If a prior archive exists, attempt to preserve its SELinux label. +- if ($has_seclabels && $has_archive) { ++ if ($has_seclabels && $has_archive && can_run('chcon')) { + copy_security_context($dst_path, $interim_path); + } + +-- +2.52.0 + diff --git a/sys-apps/locale-gen/locale-gen-3.9-r1.ebuild b/sys-apps/locale-gen/locale-gen-3.9-r2.ebuild similarity index 96% rename from sys-apps/locale-gen/locale-gen-3.9-r1.ebuild rename to sys-apps/locale-gen/locale-gen-3.9-r2.ebuild index 10e42892fd9c3..d6c8e50f4c24c 100644 --- a/sys-apps/locale-gen/locale-gen-3.9-r1.ebuild +++ b/sys-apps/locale-gen/locale-gen-3.9-r2.ebuild @@ -32,6 +32,7 @@ src_prepare() { local -x MY_EPREFIX=${EPREFIX} eapply "${FILESDIR}/${PV}-suppress-bash-setlocale-warnings.patch" + eapply "${FILESDIR}/${PV}-avoid-chcon-execution-if-missing.patch" eapply_user perl -pi -e '$f //= ($. == 1 && s/^#!\h*\K/$ENV{MY_EPREFIX}/); END { exit !$f }' "${PN}" \ From dbc99d9ff766fef81f61ca0889b7077dd763a1e1 Mon Sep 17 00:00:00 2001 From: Sam James Date: Sun, 4 Jan 2026 05:37:35 +0000 Subject: [PATCH 2/2] sys-apps/locale-gen: crank copyright Signed-off-by: Sam James --- sys-apps/locale-gen/locale-gen-3.9-r2.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys-apps/locale-gen/locale-gen-3.9-r2.ebuild b/sys-apps/locale-gen/locale-gen-3.9-r2.ebuild index d6c8e50f4c24c..7a3415080e3e9 100644 --- a/sys-apps/locale-gen/locale-gen-3.9-r2.ebuild +++ b/sys-apps/locale-gen/locale-gen-3.9-r2.ebuild @@ -1,4 +1,4 @@ -# Copyright 2023-2025 Gentoo Authors +# Copyright 2023-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8