commit:     6eb3ee215135ff6e72381dd10986719bd22365d6
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 15 11:57:52 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jul 15 11:57:52 2019 +0000
URL:        https://gitweb.gentoo.org/proj/qa-scripts.git/commit/?id=6eb3ee21

eclass-eapi-matrix: Avoid crash when @SUPPORTED_EAPIS is false

Avoid crashing on assert when @SUPPORTED_EAPIS indicates that an EAPI
is not supported yet ebuilds actually use it.  Instead, report this
as '?!'

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 eclass-eapi-matrix.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/eclass-eapi-matrix.py b/eclass-eapi-matrix.py
index 8117d63..452660f 100755
--- a/eclass-eapi-matrix.py
+++ b/eclass-eapi-matrix.py
@@ -83,8 +83,10 @@ def format_table(data):
         supp_eapis, eapis = ecl_data
         for eapi in all_eapis:
             if supp_eapis is not None and eapi not in supp_eapis:
-                assert eapis.get(eapi, 0) == 0
-                line['eapi_'+eapi] = 'xx'
+                if eapis.get(eapi, 0) > 0:
+                    line['eapi_'+eapi] = eapis[eapi] + '?!'
+                else:
+                    line['eapi_'+eapi] = 'xx'
             else:
                 line['eapi_'+eapi] = eapis.get(eapi, 0)
         ret += format_str.format(**line)

Reply via email to