From 19f8b23109eff8bd674ed105731f56dbef1d76aa Mon Sep 17 00:00:00 2001 From: Flatcar Buildbot Date: Mon, 3 Nov 2025 07:12:34 +0000 Subject: [PATCH] sys-apps/locale-gen: Sync with Gentoo It's from Gentoo commit ae7745b7dc0fe3ef421b2e67ceba8b779fd608ea. Signed-off-by: Flatcar Buildbot --- .../sys-apps/locale-gen/Manifest | 1 + ...3.9-suppress-bash-setlocale-warnings.patch | 104 ++++++++++++++++++ .../sys-apps/locale-gen/locale-gen-3.8.ebuild | 8 +- .../locale-gen/locale-gen-3.9-r1.ebuild | 72 ++++++++++++ .../locale-gen/locale-gen-9999.ebuild | 8 +- .../sys-apps/locale-gen/metadata.xml | 4 + 6 files changed, 193 insertions(+), 4 deletions(-) create mode 100644 sdk_container/src/third_party/portage-stable/sys-apps/locale-gen/files/3.9-suppress-bash-setlocale-warnings.patch create mode 100644 sdk_container/src/third_party/portage-stable/sys-apps/locale-gen/locale-gen-3.9-r1.ebuild diff --git a/sdk_container/src/third_party/portage-stable/sys-apps/locale-gen/Manifest b/sdk_container/src/third_party/portage-stable/sys-apps/locale-gen/Manifest index eba1c29c09..2c6083bb46 100644 --- a/sdk_container/src/third_party/portage-stable/sys-apps/locale-gen/Manifest +++ b/sdk_container/src/third_party/portage-stable/sys-apps/locale-gen/Manifest @@ -1,2 +1,3 @@ DIST locale-gen-2.23.tar.bz2 7664 BLAKE2B a529b62fbb840c9352f06e8f5c80fc764425a2619dc69cc820f550a026d391788d5e2cfeeb46a8b5b9716da63340b4fce57a5b523edd4196ee1219c1200cb752 SHA512 c1245caadb04403c535a836f19bc410d0f04b5c0e297ea5be9852e6d71e08e528071ae769d63d31a677dda8fdd618b4c4d581ed525cf8786b82d8f37636db754 DIST locale-gen-3.8.tar.bz2 17593 BLAKE2B 0197096021286f47f4e289ee5c4cbf0220264b5784c101df567c0a5dc81a0a83999e8306e8ab72e47f4f35f92d0f7e7e40589ff3c74936e22c56e3b5a172fb15 SHA512 6e802283bce6a927ed020d3011a9bc4a81ef017d728a698fa6a8c74887895a87d225cdbe23cf18798a12f2e58beacfdd6ba5e3990d74ebafb4b2ba5986d35720 +DIST locale-gen-3.9.tar.bz2 17793 BLAKE2B 982c6460a40ac29b9aa3f2bab42cfa7862510c715e13bb68b0b6c7f7910fd728862ed4cc2ce7a07bfe1888566a469c1264174a4f41306506d77edc7189957a7c SHA512 8bdb5e7cb19d62284291d092b03e04f2c40b52cac542192afe5e3c28776a88f4452efdd6dd76a6719fe7b73edf37b916322db4d048c08fd7d03d6d3474fdd6fe diff --git a/sdk_container/src/third_party/portage-stable/sys-apps/locale-gen/files/3.9-suppress-bash-setlocale-warnings.patch b/sdk_container/src/third_party/portage-stable/sys-apps/locale-gen/files/3.9-suppress-bash-setlocale-warnings.patch new file mode 100644 index 0000000000..dadbd55d9b --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-apps/locale-gen/files/3.9-suppress-bash-setlocale-warnings.patch @@ -0,0 +1,104 @@ +From a4dbd5aa801fbe5510a7bc10af1027b6ce19061b Mon Sep 17 00:00:00 2001 +From: Kerin Millar +Date: Fri, 31 Oct 2025 19:44:55 +0000 +Subject: [PATCH] Suppress bash warnings regarding setlocale(3) failures + +Presently, there are five instances in which sh(1) will be executed by +locale-gen(8). Consequently, irritating warnings will be raised where +both of the following conditions hold true. + +- bash(1) is the effective /bin/sh implementation +- the LC_ALL environment variable is set as an unavailable locale + +For example: + +$ LC_ALL=unavailable bash -c '' +bash: warning: setlocale: LC_ALL: cannot change locale (unavailable): No +such file or directory + +This occurs because bash chooses to report setlocale(3) failures. While +there is nothing wrong in doing so, to encounter such warnings while +executing locale-gen(8) is tantamount to noise. Address this annoyance +by having Perl ensure that the execve(2) call responsible for launching +sh(1) specifies LC_ALL as 'C'. + +See-also: 04c08067b15933d195d8500eefdc363cb46c1b32 +Signed-off-by: Kerin Millar +--- + locale-gen | 32 +++++++++++++++++++++++--------- + 1 file changed, 23 insertions(+), 9 deletions(-) + +diff --git a/locale-gen b/locale-gen +index 3f825b4..a65b99a 100644 +--- a/locale-gen ++++ b/locale-gen +@@ -138,7 +138,10 @@ umask 0022; + } + + sub get_locale_dir () { +- my $stdout = qx{ LC_ALL=C localedef --help 2>/dev/null }; ++ my $stdout = do { ++ local $ENV{'LC_ALL'} = 'C'; ++ qx{ localedef --help 2>/dev/null }; ++ }; + if ($? == 0 && $stdout =~ m/\hlocale path\h*:\s+(\/[^:]+)/) { + return canonpath($1); + } elsif (($? & 0x7F) == 0) { +@@ -415,7 +418,10 @@ sub check_archive_dir ($prefix, $locale_dir) { + my $archive_dir = local $ENV{'DIR'} = catdir($prefix, $locale_dir); + + # Quietly attempt to create the directory if it does not already exist. +- system q{ mkdir -p -- "$DIR" 2>/dev/null }; ++ { ++ local $ENV{'LC_ALL'} = 'C'; ++ system q{ mkdir -p -- "$DIR" 2>/dev/null }; ++ } + + # Check whether the directory exists and can be modified by the EUID. + if (! utime undef, undef, $archive_dir) { +@@ -609,8 +615,10 @@ sub check_effective_locale ($supported_by) { + } + + sub copy_security_context ($src_path, $dst_path) { +- local @ENV{'SRC_PATH', 'DST_PATH'} = ($src_path, $dst_path); +- my $stderr = qx{ LC_ALL=C chcon --reference="\$SRC_PATH" -- "\$DST_PATH" 2>&1 >/dev/null }; ++ my $stderr = do { ++ local @ENV{'LC_ALL', 'SRC_PATH', 'DST_PATH'} = ('C', $src_path, $dst_path); ++ qx{ chcon --reference="\$SRC_PATH" -- "\$DST_PATH" 2>&1 >/dev/null }; ++ }; + # Throw exceptions for any errors that are not a consequence of ENOTSUP. + if ($? != 0 && $stderr !~ m/: Operation not supported$/m) { + if (length $stderr) { +@@ -631,7 +639,11 @@ sub fopen ($path) { + } + + sub get_nprocs () { +- chomp(my $nproc = qx{ { nproc || getconf _NPROCESSORS_CONF; } 2>/dev/null }); ++ my $nproc = do { ++ local $ENV{'LC_ALL'} = 'C'; ++ qx{ { nproc || getconf _NPROCESSORS_CONF; } 2>/dev/null }; ++ }; ++ chomp $nproc; + return $nproc; + } + +@@ -693,10 +705,12 @@ sub dirname ($path) { + sub has_mount_option ($target, $option) { + # Per bug 962817, / may not necessarily exist as a mountpoint. Assuming + # it does not, ignore the case that findmnt(8) exits with a status of 1. +- local $ENV{'TARGET'} = $target; +- my $stdout = qx{ +- findmnt -no options -T "\$TARGET" +- case \$? in 1) ! mountpoint -q / ;; *) exit "\$?" ;; esac ++ my $stdout = do { ++ local @ENV{'LC_ALL', 'TARGET'} = ('C', $target); ++ qx{ ++ findmnt -no options -T "\$TARGET" ++ case \$? in 1) ! mountpoint -q / ;; *) exit "\$?" ;; esac ++ }; + }; + throw_child_error('findmnt'); + chomp $stdout; +-- +2.51.2 + diff --git a/sdk_container/src/third_party/portage-stable/sys-apps/locale-gen/locale-gen-3.8.ebuild b/sdk_container/src/third_party/portage-stable/sys-apps/locale-gen/locale-gen-3.8.ebuild index 5c7fc7a3b9..c13cdde979 100644 --- a/sdk_container/src/third_party/portage-stable/sys-apps/locale-gen/locale-gen-3.8.ebuild +++ b/sdk_container/src/third_party/portage-stable/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" diff --git a/sdk_container/src/third_party/portage-stable/sys-apps/locale-gen/locale-gen-3.9-r1.ebuild b/sdk_container/src/third_party/portage-stable/sys-apps/locale-gen/locale-gen-3.9-r1.ebuild new file mode 100644 index 0000000000..147b5a7ed0 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-apps/locale-gen/locale-gen-3.9-r1.ebuild @@ -0,0 +1,72 @@ +# Copyright 2023-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Generate locales based upon the config file /etc/locale.gen" +HOMEPAGE="https://gitweb.gentoo.org/proj/locale-gen.git/" + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/locale-gen.git" + inherit git-r3 +else + SRC_URI="https://gitweb.gentoo.org/proj/locale-gen.git/snapshot/${P}.tar.bz2" + + KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~loong ~m68k ~mips ppc ~ppc64 ~riscv ~s390 ~sparc x86" +fi + +LICENSE="GPL-2" +SLOT="0" + +BDEPEND=" + >=dev-lang/perl-5.36 + dev-perl/File-Slurper +" +RDEPEND=" + >=dev-lang/perl-5.36 + !toolchain@gentoo.org Gentoo Toolchain Project + + kfm@plushkava.net + Kerin Millar + proj/locale-gen gentoo/locale-gen