sys-apps/locale-gen: add 3.2-r1 and 3.3-r1 and revise 9999 per bug #961743

Upon locale-gen-3.0 being introduced, the ebuild lost the ability to
prefixify the locale-gen script in src_prepare(). Address this issue so
that the shebang is properly adjusted for Gentoo Prefix environments.

I eschewed the use of the prefix eclass because I consider its
implementation to be substandard. I also eschewed the use of sed(1)
because it encourages pattern injection and seldom returns a useful exit
status. Instead, perl is used to replace the shebang. I could think of
no reason not to, given that dev-lang/perl is already a requirement.

Reported-by: Nick Bowler <nbowler@draconx.ca>
Fixes: ecc3beb504
Closes: https://bugs.gentoo.org/961743
Signed-off-by: Kerin Millar <kfm@plushkava.net>
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Kerin Millar
2025-08-19 01:04:25 +01:00
committed by Sam James
parent 6e3138fee0
commit 83bbfec251
3 changed files with 38 additions and 0 deletions

View File

@@ -18,11 +18,25 @@ fi
LICENSE="GPL-2"
SLOT="0"
# In-place editing became safer in v5.28.
BDEPEND="
>=dev-lang/perl-5.28
"
RDEPEND="
>=dev-lang/perl-5.36
!<sys-libs/glibc-2.37-r3
"
src_prepare() {
# EPREFIX is readonly.
local -x MY_EPREFIX=${EPREFIX}
eapply_user
perl -pi -e '$f //= ($. == 1 && s/^#!\K\//$ENV{MY_EPREFIX}\//); END { exit !$f }' "${PN}" \
|| die "Failed to prefixify ${PN}"
}
src_install() {
dosbin locale-gen
doman *.[0-8]

View File

@@ -18,11 +18,25 @@ fi
LICENSE="GPL-2"
SLOT="0"
# In-place editing became safer in v5.28.
BDEPEND="
>=dev-lang/perl-5.28
"
RDEPEND="
>=dev-lang/perl-5.36
!<sys-libs/glibc-2.37-r3
"
src_prepare() {
# EPREFIX is readonly.
local -x MY_EPREFIX=${EPREFIX}
eapply_user
perl -pi -e '$f //= ($. == 1 && s/^#!\K\//$ENV{MY_EPREFIX}\//); END { exit !$f }' "${PN}" \
|| die "Failed to prefixify ${PN}"
}
src_install() {
dosbin locale-gen
doman *.[0-8]

View File

@@ -27,6 +27,16 @@ RDEPEND="
!<sys-libs/glibc-2.37-r3
"
src_prepare() {
# EPREFIX is readonly.
local -x MY_EPREFIX=${EPREFIX}
eapply_user
perl -pi -e '$f //= ($. == 1 && s/^#!\K\//$ENV{MY_EPREFIX}\//); END { exit !$f }' "${PN}" \
|| die "Failed to prefixify ${PN}"
}
src_install() {
dosbin locale-gen
doman *.[0-8]