commit:     c310e44692ad91777c71394dda97cd1f33f72589
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Aug  4 23:43:05 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Aug  4 23:48:57 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c310e446

metadata/install-qa-check.d: don't fail if has_version died

During Python target migrations, if portage[-ipc], portageq can't
be invoked as a binary (which has_version does behind the scenes w/ -ipc),
so just call it w/ nonfatal, to avoid aborting the emerge and possibly
hurting the system (imagine python-exec gets upgraded but portage
wasn't yet).

Fails like:
```

${EPREFIX}/Gentoo/usr/lib/python-exec/python3.9/portageq: this Python 
implementation (python3.9) is not supported by the script.
 * ERROR: app-admin/perl-cleaner-2.30::gentoo_prefix failed:
 *   has_version: unexpected portageq exit code: 127
 *
 * Call stack:
 *   misc-functions.sh, line 1334:  Called install_qa_check
 *   misc-functions.sh, line  138:  Called source 'install_symlink_html_docs'
 *        60python-pyc, line  118:  Called python_pyc_check
 *        60python-pyc, line   22:  Called has_version 'install_hooks'
 *    phase-helpers.sh, line  986:  Called 
___best_version_and_has_version_common 
'${EPREFIX}/Gentoo/var/db/repos/gentoo/metadata/install-qa-check.d/60python-pyc'
 *    phase-helpers.sh, line  973:  Called die
 * The specific snippet of code:
 *                              die "${FUNCNAME[1]}: unexpected portageq exit 
code: ${retval}"
```

Bug: https://bugs.gentoo.org/778014
Signed-off-by: Sam James <sam <AT> gentoo.org>

 metadata/install-qa-check.d/60python-pyc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/metadata/install-qa-check.d/60python-pyc 
b/metadata/install-qa-check.d/60python-pyc
index 4679070328c0..fdd232422880 100644
--- a/metadata/install-qa-check.d/60python-pyc
+++ b/metadata/install-qa-check.d/60python-pyc
@@ -19,7 +19,7 @@ python_pyc_check() {
        # Avoid running the check if sufficiently new gpep517 is not installed
        # yet. It's valid to schedule (for merge order) >=gpep517-8 after
        # packages which have this check run if they don't use distutils-r1.
-       has_version ">=dev-python/gpep517-8" || return
+       nonfatal has_version ">=dev-python/gpep517-8" || return
 
        for prog in "${progs[@]}"; do
                local impl=${prog%/*}

Reply via email to