From 22a6e3a16f64c2d509309bbb486d48dbae1f873d Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Fri, 2 Aug 2024 16:04:28 +0200 Subject: [PATCH] eclass/check-reqs: Sync with Gentoo It's from Gentoo commit e105854611974017415af6199d521b78f1134ff4. --- .../portage-stable/eclass/check-reqs.eclass | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/sdk_container/src/third_party/portage-stable/eclass/check-reqs.eclass b/sdk_container/src/third_party/portage-stable/eclass/check-reqs.eclass index 2130e2e349..fac2f4553d 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/check-reqs.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/check-reqs.eclass @@ -1,4 +1,4 @@ -# Copyright 2004-2021 Gentoo Authors +# Copyright 2004-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: check-reqs.eclass @@ -40,35 +40,33 @@ case ${EAPI} in 6|7|8) ;; - *) die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac -EXPORT_FUNCTIONS pkg_pretend pkg_setup - -if [[ ! ${_CHECK_REQS_ECLASS} ]]; then +if [[ -z ${_CHECK_REQS_ECLASS} ]]; then _CHECK_REQS_ECLASS=1 -# @ECLASS-VARIABLE: CHECKREQS_MEMORY +# @ECLASS_VARIABLE: CHECKREQS_MEMORY # @DEFAULT_UNSET # @DESCRIPTION: # How much RAM is needed? Eg.: CHECKREQS_MEMORY=15M -# @ECLASS-VARIABLE: CHECKREQS_DISK_BUILD +# @ECLASS_VARIABLE: CHECKREQS_DISK_BUILD # @DEFAULT_UNSET # @DESCRIPTION: # How much diskspace is needed to build the package? Eg.: CHECKREQS_DISK_BUILD=2T -# @ECLASS-VARIABLE: CHECKREQS_DISK_USR +# @ECLASS_VARIABLE: CHECKREQS_DISK_USR # @DEFAULT_UNSET # @DESCRIPTION: # How much space in /usr is needed to install the package? Eg.: CHECKREQS_DISK_USR=15G -# @ECLASS-VARIABLE: CHECKREQS_DISK_VAR +# @ECLASS_VARIABLE: CHECKREQS_DISK_VAR # @DEFAULT_UNSET # @DESCRIPTION: # How much space is needed in /var? Eg.: CHECKREQS_DISK_VAR=3000M -# @ECLASS-VARIABLE: CHECKREQS_DONOTHING +# @ECLASS_VARIABLE: CHECKREQS_DONOTHING # @USER_VARIABLE # @DEFAULT_UNSET # @DESCRIPTION: @@ -76,6 +74,12 @@ _CHECK_REQS_ECLASS=1 # This is a user flag and should under _no circumstances_ be set in the ebuild. [[ -n ${I_KNOW_WHAT_I_AM_DOING} ]] && CHECKREQS_DONOTHING=1 +# @ECLASS_VARIABLE: CHECKREQS_FAILED +# @INTERNAL +# @DESCRIPTION: +# If set the checks failed and eclass should abort the build. +# Internal, do not set yourself. + # @FUNCTION: check-reqs_pkg_setup # @DESCRIPTION: # Exported function running the resources checks in pkg_setup phase. @@ -287,9 +291,11 @@ _check-reqs_output() { [[ ${EBUILD_PHASE} == "pretend" && -z ${CHECKREQS_DONOTHING} ]] && msg="eerror" if [[ -n ${CHECKREQS_FAILED} ]]; then ${msg} - ${msg} "Space constraints set in the ebuild were not met!" - ${msg} "The build will most probably fail, you should enhance the space" - ${msg} "as per failed tests." + ${msg} "Memory or space constraints set in the ebuild were not met!" + ${msg} "The build will most probably fail, you should:" + ${msg} "- enhance the memory (reduce MAKEOPTS, add swap), or" + ${msg} "- add more space" + ${msg} "as required depending on the failed tests." ${msg} [[ ${EBUILD_PHASE} == "pretend" && -z ${CHECKREQS_DONOTHING} ]] && \ @@ -457,12 +463,9 @@ _check-reqs_unsatisfied() { [[ ${EBUILD_PHASE} == "pretend" && -z ${CHECKREQS_DONOTHING} ]] && msg="eerror" ${msg} "There is NOT at least ${sizeunit} ${location}" - # @ECLASS-VARIABLE: CHECKREQS_FAILED - # @INTERNAL - # @DESCRIPTION: - # If set the checks failed and eclass should abort the build. - # Internal, do not set yourself. CHECKREQS_FAILED="true" } fi + +EXPORT_FUNCTIONS pkg_pretend pkg_setup