commit:     24a41221936c62648df7813ab9b914dbebc3b2c5
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 13 04:24:32 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul 13 04:25:15 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24a41221

sys-libs/glibc: inline eend_KV

Otherwise, a WIP check for pkgcheck gets confused by imbalanced ebegin
without eend (or at least without a die there).

Will backport to older versions later.

Bug: https://github.com/pkgcore/pkgcheck/issues/737
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-libs/glibc/glibc-9999.ebuild | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
index f7b71aa86561..2f7f58fcccd4 100644
--- a/sys-libs/glibc/glibc-9999.ebuild
+++ b/sys-libs/glibc/glibc-9999.ebuild
@@ -768,11 +768,6 @@ g_int_to_KV() {
        echo ${major}.${minor}.${micro}
 }
 
-eend_KV() {
-       [[ $(g_KV_to_int $1) -ge $(g_KV_to_int $2) ]]
-       eend $?
-}
-
 get_kheader_version() {
        printf '#include <linux/version.h>\nLINUX_VERSION_CODE\n' | \
        $(tc-getCPP ${CTARGET}) -I "${ESYSROOT}$(alt_headers)" - | \
@@ -866,11 +861,13 @@ sanity_prechecks() {
                        if ! is_crosscompile && ! tc-is-cross-compiler ; then
                                # Building fails on an non-supporting kernel
                                ebegin "Checking running kernel version 
(${run_kv} >= ${want_kv})"
-                               if ! eend_KV ${run_kv} ${want_kv} ; then
+                               if ! [[ $(g_KV_to_int ${run_kv}) -ge 
$(g_KV_to_int ${want_kv}) ]] ; then
+                                       eend 1
                                        echo
                                        eerror "You need a kernel of at least 
${want_kv}!"
                                        die "Kernel version too low!"
                                fi
+                               eend 0
                        fi
 
                        # Do not run this check for pkg_pretend, just pkg_setup 
and friends (if we ever get used there).
@@ -881,11 +878,13 @@ sanity_prechecks() {
                        # but let's leave it as-is for now.
                        if [[ ${EBUILD_PHASE_FUNC} != pkg_pretend ]] ; then
                                ebegin "Checking linux-headers version 
(${build_kv} >= ${want_kv})"
-                               if ! eend_KV ${build_kv} ${want_kv} ; then
+                               if ! [[ $(g_KV_to_int ${build_kv}) -ge 
$(g_KV_to_int ${want_kv}) ]] ; then
+                                       eend 1
                                        echo
                                        eerror "You need linux-headers of at 
least ${want_kv}!"
                                        die "linux-headers version too low!"
                                fi
+                               eend 0
                        fi
                fi
        fi

Reply via email to