Backport a bunch of QA notice changes so tinderboxes etc can pick them up, given portage.git is currently undergoing a fair bit of refactoring. https://github.com/gentoo/portage/commit/7b44116b4a669a49e51e5a495ab62a25229e18e4 https://github.com/gentoo/portage/commit/8ded447a1d194ad0190a174f7bb330417685d861 https://github.com/gentoo/portage/commit/23c4a45827fccebb969d5130ccc234ed3d1a9b35 https://github.com/gentoo/portage/commit/3994939f982f22afbc7aaf3b8eca6680ad85c617 From: Sam James Date: Sat, 2 Apr 2022 05:10:31 +0100 Subject: [PATCH] bin/install-qa-check.d/95empty-dirs: update message for EAPI 8 Portage changed the default for >= EAPI 8 ("newer EAPIs" at the time, not actually specific to 8) in bfda0d2bd4ba03a4e77f488ec3fd4f9c6c351662 to enable FEATURES="strict-keepdir". Signed-off-by: Sam James Closes: https://github.com/gentoo/portage/pull/802 Signed-off-by: Sam James --- a/bin/install-qa-check.d/95empty-dirs +++ b/bin/install-qa-check.d/95empty-dirs @@ -33,7 +33,7 @@ find_empty_dirs() { done eqawarn eqawarn "If those directories need to be preserved, please make sure to create" - eqawarn "or mark them for keeping using 'keepdir'. Future versions of Portage" + eqawarn "or mark them for keeping using 'keepdir'. Portage for >= EAPI 8 ebuilds" eqawarn "will strip empty directories from installation image." fi } From: Sam James Date: Sun, 10 Apr 2022 17:51:02 +0100 Subject: [PATCH] install-qa-check.d/20runtime-directories: warn on /var/tmp too Bug: https://bugs.gentoo.org/493154 Bug: https://bugs.gentoo.org/837536 Signed-off-by: Sam James --- a/bin/install-qa-check.d/20runtime-directories +++ b/bin/install-qa-check.d/20runtime-directories @@ -1,10 +1,10 @@ # Check for directories that need to be created at runtime runtime_dir_check() { - # It's ok create these directories, but not to install into them. #493154 + # It's ok to create these directories, but not to install into them. #493154 # TODO: We should add var/lib to this list. local x f= - for x in var/cache var/lock var/run run ; do + for x in var/cache var/lock var/run var/tmp run ; do if [[ ! -L ${ED}/${x} && -d ${ED}/${x} ]] ; then if [[ -z $(find "${ED}/${x}" -prune -empty) ]] ; then f+=$(cd "${ED}"; find "${x}" -printf ' %p\n') From: Thomas Bracht Laumann Jespersen Date: Mon, 11 Apr 2022 15:46:06 +0200 Subject: [PATCH] eend: Output QA warning if ebegin has not been called The assumption here is that ebegin-eend aren't nested. Closes: https://bugs.gentoo.org/835824 Signed-off-by: Thomas Bracht Laumann Jespersen Closes: https://github.com/gentoo/portage/pull/807 Signed-off-by: Sam James --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -339,6 +339,7 @@ ebegin() { [[ ${RC_ENDCOL} == "yes" ]] && echo >&2 LAST_E_LEN=$(( 3 + ${#RC_INDENTATION} + ${#msg} )) LAST_E_CMD="ebegin" + EBEGIN_EEND=1 return 0 } @@ -367,6 +368,11 @@ __eend() { eend() { [[ -n $1 ]] || eqawarn "QA Notice: eend called without first argument" + if [[ -v EBEGIN_EEND ]] ; then + unset EBEGIN_EEND + else + eqawarn "QA Notice: eend called without preceding ebegin (phase: ${EBUILD_PHASE})" + fi local retval=${1:-0} shift From: Thomas Bracht Laumann Jespersen Date: Tue, 12 Apr 2022 10:59:11 +0200 Subject: [PATCH] ebegin: Output QA warning if call to eend is missing The idea here is to check if EBEGIN_EEND is set after the phase has been executed. If so, then a call to eend is probably missing. This is under the assumption that ebegin-eend invocations should be properly paired within the same phase. In ebegin, the EBEGIN_EEND variable is also checked, and, if set, indicates that ebegin has been called and is missing the closing call to eend. I doubt that this check is perfect, but it seems to work in what little testing I've done. Closes: https://bugs.gentoo.org/835823 Signed-off-by: Thomas Bracht Laumann Jespersen Closes: https://github.com/gentoo/portage/pull/811 Signed-off-by: Sam James --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -339,6 +339,9 @@ ebegin() { [[ ${RC_ENDCOL} == "yes" ]] && echo >&2 LAST_E_LEN=$(( 3 + ${#RC_INDENTATION} + ${#msg} )) LAST_E_CMD="ebegin" + if [[ -v EBEGIN_EEND ]] ; then + eqawarn "QA Notice: ebegin called, but missing call to eend (phase: ${EBUILD_PHASE})" + fi EBEGIN_EEND=1 return 0 } --- a/bin/phase-functions.sh +++ b/bin/phase-functions.sh @@ -1088,6 +1088,10 @@ __ebuild_main() { ;; esac + if [[ -v EBEGIN_EEND ]] ; then + eqawarn "QA Notice: ebegin called, but missing call to eend (phase: ${1})" + fi + # Save the env only for relevant phases. if ! has "${1}" clean help info nofetch ; then umask 002