From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A227513832E for ; Sat, 13 Aug 2016 23:03:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A513321C04E; Sat, 13 Aug 2016 23:03:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2C42921C03E for ; Sat, 13 Aug 2016 23:03:31 +0000 (UTC) Received: from localhost.localdomain (ip68-5-185-102.oc.oc.cox.net [68.5.185.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: zmedico) by smtp.gentoo.org (Postfix) with ESMTPSA id 95351340C7B; Sat, 13 Aug 2016 23:03:29 +0000 (UTC) From: Zac Medico To: gentoo-portage-dev@lists.gentoo.org Cc: Zac Medico Subject: [gentoo-portage-dev] [PATCH] repoman: fix erroneous LICENSE.syntax (bug 591184) Date: Sat, 13 Aug 2016 16:00:59 -0700 Message-Id: <1471129259-17165-1-git-send-email-zmedico@gentoo.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org X-Archives-Salt: ac3df234-226e-41d5-84af-def674796309 X-Archives-Hash: 9ed6b12ac766621c92dac8e11e56c3ac X-Gentoo-bug: 591184 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=591184 --- .../pym/repoman/modules/scan/depend/_depend_checks.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/repoman/pym/repoman/modules/scan/depend/_depend_checks.py b/repoman/pym/repoman/modules/scan/depend/_depend_checks.py index 3f6c93e..f0ae863 100644 --- a/repoman/pym/repoman/modules/scan/depend/_depend_checks.py +++ b/repoman/pym/repoman/modules/scan/depend/_depend_checks.py @@ -27,7 +27,7 @@ def check_slotop(depstr, is_valid_flag, badsyntax, mytype, token_class=portage.dep.Atom) except portage.exception.InvalidDependString as e: my_dep_tree = None - badsyntax.append(str(e)) + badsyntax.append((mytype, str(e))) def _traverse_tree(dep_tree, in_any_of): # leaf @@ -67,7 +67,7 @@ def _depend_checks(ebuild, pkg, portdb, qatracker, repo_metadata): "java-pkg-opt-2" in ebuild.inherited, inherited_wxwidgets_eclass = "wxwidgets" in ebuild.inherited # operator_tokens = set(["||", "(", ")"]) - type_list, badsyntax = [], [] + badsyntax = [] for mytype in Package._dep_keys + ("LICENSE", "PROPERTIES", "PROVIDE"): mydepstr = ebuild.metadata[mytype] @@ -83,7 +83,7 @@ def _depend_checks(ebuild, pkg, portdb, qatracker, repo_metadata): is_valid_flag=pkg.iuse.is_valid_flag, token_class=token_class) except portage.exception.InvalidDependString as e: atoms = None - badsyntax.append(str(e)) + badsyntax.append((mytype, str(e))) if atoms and mytype.endswith("DEPEND"): if runtime and \ @@ -156,13 +156,11 @@ def _depend_checks(ebuild, pkg, portdb, qatracker, repo_metadata): check_missingslot(atom, mytype, ebuild.eapi, portdb, qatracker, ebuild.relative_path, ebuild.metadata) - type_list.extend([mytype] * (len(badsyntax) - len(type_list))) - if runtime: check_slotop(mydepstr, pkg.iuse.is_valid_flag, badsyntax, mytype, qatracker, ebuild.relative_path) - for m, b in zip(type_list, badsyntax): + for m, b in badsyntax: if m.endswith("DEPEND"): qacat = "dependency.syntax" else: @@ -171,9 +169,9 @@ def _depend_checks(ebuild, pkg, portdb, qatracker, repo_metadata): qacat, "%s: %s: %s" % (ebuild.relative_path, m, b)) # data required for some other tests - badlicsyntax = len([z for z in type_list if z == "LICENSE"]) - badprovsyntax = len([z for z in type_list if z == "PROVIDE"]) - baddepsyntax = len(type_list) != badlicsyntax + badprovsyntax + badlicsyntax = len([z for z in badsyntax if z[0] == "LICENSE"]) + badprovsyntax = len([z for z in badsyntax if z[0] == "PROVIDE"]) + baddepsyntax = len(badsyntax) != badlicsyntax + badprovsyntax badlicsyntax = badlicsyntax > 0 #badprovsyntax = badprovsyntax > 0 -- 2.7.4