From dc15a4da63581db45b10c5b35dd905a53dd5c973 Mon Sep 17 00:00:00 2001 From: Flatcar Buildbot Date: Mon, 14 Aug 2023 07:11:38 +0000 Subject: [PATCH] eclass/python-utils-r1: Sync with Gentoo It's from Gentoo commit bafc7b5a1fc937b08a67be7c628f225674a3303d. --- .../eclass/python-utils-r1.eclass | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/sdk_container/src/third_party/portage-stable/eclass/python-utils-r1.eclass b/sdk_container/src/third_party/portage-stable/eclass/python-utils-r1.eclass index 27157a003a..2fffd6d56b 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/python-utils-r1.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/python-utils-r1.eclass @@ -338,7 +338,9 @@ _python_export() { debug-print "${FUNCNAME}: EPYTHON = ${EPYTHON}" ;; PYTHON) - export PYTHON=${BROOT}/usr/bin/${impl} + # Under EAPI 7+, this should just use ${BROOT}, but Portage + # <3.0.50 was buggy, and prefix users need this to update. + export PYTHON=${BROOT-${EPREFIX}}/usr/bin/${impl} debug-print "${FUNCNAME}: PYTHON = ${PYTHON}" ;; PYTHON_SITEDIR) @@ -1244,14 +1246,13 @@ _python_check_occluded_packages() { # positives before filing bugs. [[ ! ${PYTHON_EXPERIMENTAL_QA} ]] && return - type -P diff &>/dev/null || return [[ -z ${BUILD_DIR} || ! -d ${BUILD_DIR}/install ]] && return local sitedir="${BUILD_DIR}/install$(python_get_sitedir)" # avoid unnecessarily checking if we are inside install dir [[ ${sitedir} -ef . ]] && return - local f fn diff + local f fn diff l for f in "${sitedir}"/*/; do f=${f%/} fn=${f##*/} @@ -1260,17 +1261,29 @@ _python_check_occluded_packages() { [[ ${fn} == *.dist-info || ${fn} == *.egg-info ]] && continue if [[ -d ${fn} ]]; then - diff=$(diff -dupr -x "__pycache__" "${fn}" "${sitedir}/${fn}") + diff=$( + comm -1 -3 <( + find "${fn}" -type f -not -path '*/__pycache__/*' | + sort + assert + ) <( + cd "${sitedir}" && + find "${fn}" -type f -not -path '*/__pycache__/*' | + sort + assert + ) + ) + if [[ -n ${diff} ]]; then eqawarn "The directory ${fn} occludes package installed for ${EPYTHON}." - echo - echo ">>> Diff:" - echo "${diff}" - echo "<<< End-of-diff" - echo + eqawarn "The installed package includes additional files:" + eqawarn + while IFS= read -r l; do + eqawarn " ${l}" + done <<<"${diff}" + eqawarn if [[ ! ${_PYTHON_WARNED_OCCLUDED_PACKAGES} ]]; then - eqawarn "The complete build log includes diffs." eqawarn "For more information on occluded packages, please see:" eqawarn "https://projects.gentoo.org/python/guide/test.html#importerrors-for-c-extensions" _PYTHON_WARNED_OCCLUDED_PACKAGES=1