commit:     6104b16733597cab10316fe7765a3b7120c5ae26
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Thu Oct 16 08:05:20 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct 17 21:22:07 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6104b167

sys-apps/locale-gen: Run mkconfig only where SUPPORTED can be found

The mkconfig utility is used to incorporate commented examples of every
supported glibc locale into the /etc/locale.gen file. However, there are
sitautions in which the SUPPORTED file will not be present, such as
where cross-compiling from a musl environment.

For now, address this issue by only running mkconfig in the case that
the SUPPORTED file is found to exist.

Closes: https://bugs.gentoo.org/964382
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-apps/locale-gen/locale-gen-3.8.ebuild | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sys-apps/locale-gen/locale-gen-3.8.ebuild 
b/sys-apps/locale-gen/locale-gen-3.8.ebuild
index 5c7fc7a3b931..c13cdde97979 100644
--- a/sys-apps/locale-gen/locale-gen-3.8.ebuild
+++ b/sys-apps/locale-gen/locale-gen-3.8.ebuild
@@ -47,8 +47,12 @@ src_install() {
                # See the locale.gen(5) and locale-gen(8) man pages for more 
details.
 
                EOF
-               # Run the interpreter by name so as not to have to prefixify 
mkconfig.
-               perl mkconfig "${EROOT}"
+               if [[ -e ${EROOT}/usr/share/i18n/SUPPORTED ]]; then
+                       # Run the interpreter by name so as not to have to 
prefixify.
+                       perl mkconfig "${EROOT}"
+               else
+                       ewarn "Skipping the incorporation of locale.gen 
examples because the SUPPORTED file is absent"
+               fi
        } | newins - locale.gen
        if (( PIPESTATUS[0] || PIPESTATUS[1] )); then
                die "Failed to generate and/or install locale.gen"

Reply via email to