diff options
author | Sam James <sam@gentoo.org> | 2022-06-08 23:29:21 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-06-08 23:30:36 +0100 |
commit | c80fd324b0ab7cafb11847dff2d6c7b23ade2997 (patch) | |
tree | 15031e210c33387287b4abce987072aeeac4ccaf | |
parent | sci-mathematics/cgal: drop 5.1-r2, 5.2-r2, 5.2.2-r1 (diff) | |
download | gentoo-c80fd324b0ab7cafb11847dff2d6c7b23ade2997.tar.gz gentoo-c80fd324b0ab7cafb11847dff2d6c7b23ade2997.tar.bz2 gentoo-c80fd324b0ab7cafb11847dff2d6c7b23ade2997.zip |
sys-libs/glibc: fix linux-headers check
The comment in the ebuild tries to say it all, but the gist is that
because the environment (which includes installed packages and their versions!)
isn't (necessarily) consistent b/t pkg_pretend and pkg_setup, and pkg_pretend
is run before any packages are merged at all, if one has an old linux-headers
installed, and a new linux-headers is queued to upgrade before glibc, the
emerge will still die in pkg_pretend b/c it's run before the new linux-headers
(or indeed anything) gets merged.
Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r-- | sys-libs/glibc/glibc-9999.ebuild | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild index 8c330f867cbc..2a030e2f9928 100644 --- a/sys-libs/glibc/glibc-9999.ebuild +++ b/sys-libs/glibc/glibc-9999.ebuild @@ -785,11 +785,19 @@ sanity_prechecks() { fi fi - ebegin "Checking linux-headers version (${build_kv} >= ${want_kv})" - if ! eend_KV ${build_kv} ${want_kv} ; then - echo - eerror "You need linux-headers of at least ${want_kv}!" - die "linux-headers version too low!" + # Do not run this check for pkg_pretend, just pkg_setup and friends (if we ever get used there). + # It's plausible (seen it in the wild) that Portage will (correctly) schedule a linux-headers + # upgrade before glibc, but because pkg_pretend gets run before any packages are merged at all (not + # just glibc), the whole emerge gets aborted without a good reason. We probably don't + # need to run this check at all given we have a dependency on the right headers, + # 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 + echo + eerror "You need linux-headers of at least ${want_kv}!" + die "linux-headers version too low!" + fi fi fi fi |