From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A3CED58973 for ; Sat, 30 Jan 2016 06:59:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 795DE21C04B; Sat, 30 Jan 2016 06:59:01 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3C10021C05B for ; Sat, 30 Jan 2016 06:59:00 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5DC03340CD7 for ; Sat, 30 Jan 2016 06:58:59 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E8D28FF9 for ; Sat, 30 Jan 2016 06:58:54 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1454136717.3c582beb1fc5fa5ba30ce7176c465243cf6ab0f5.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/depend/, pym/repoman/ X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/modules/scan/depend/__init__.py pym/repoman/modules/scan/depend/unknown.py pym/repoman/scanner.py X-VCS-Directories: pym/repoman/modules/scan/depend/ pym/repoman/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 3c582beb1fc5fa5ba30ce7176c465243cf6ab0f5 X-VCS-Branch: repoman Date: Sat, 30 Jan 2016 06:58:54 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: f759089a-3371-4c92-aba9-e9acd9274f0b X-Archives-Hash: 844ea62eed40401f7a38e4a50eb7a19c commit: 3c582beb1fc5fa5ba30ce7176c465243cf6ab0f5 Author: Brian Dolbec gentoo org> AuthorDate: Mon Jan 4 08:09:33 2016 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Sat Jan 30 06:51:57 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=3c582beb repoman: Create a new DependUnknown plugin class pym/repoman/modules/scan/depend/__init__.py | 9 +++++++++ pym/repoman/modules/scan/depend/unknown.py | 30 +++++++++++++++++++++++++++++ pym/repoman/scanner.py | 10 +--------- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/pym/repoman/modules/scan/depend/__init__.py b/pym/repoman/modules/scan/depend/__init__.py index cddb7f1..9fd7970 100644 --- a/pym/repoman/modules/scan/depend/__init__.py +++ b/pym/repoman/modules/scan/depend/__init__.py @@ -28,6 +28,15 @@ module_spec = { 'func_desc': { }, }, + 'unknown-module': { + 'name': "unknown", + 'sourcefile': "unknown", + 'class': "DependUnknown", + 'description': doc, + 'functions': ['check'], + 'func_desc': { + }, + }, } } diff --git a/pym/repoman/modules/scan/depend/unknown.py b/pym/repoman/modules/scan/depend/unknown.py new file mode 100644 index 0000000..61d51b9 --- /dev/null +++ b/pym/repoman/modules/scan/depend/unknown.py @@ -0,0 +1,30 @@ +# -*- coding:utf-8 -*- + + +class DependUnknown(object): + + def __init__(self, **kwargs): + self.qatracker = kwargs.get('qatracker') + + def check(self, **kwargs): + ebuild = kwargs.get('ebuild') + baddepsyntax = kwargs.get('baddepsyntax') + unknown_pkgs = kwargs.get('unknown_pkgs') + + if not baddepsyntax and unknown_pkgs: + type_map = {} + for mytype, atom in unknown_pkgs: + type_map.setdefault(mytype, set()).add(atom) + for mytype, atoms in type_map.items(): + self.qatracker.add_error( + "dependency.unknown", "%s: %s: %s" + % (ebuild.relative_path, mytype, ", ".join(sorted(atoms)))) + return {'continue': False} + + @property + def runInPkgs(self): + return (False, []) + + @property + def runInEbuilds(self): + return (True, [self.check]) diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py index 48b60a4..1e61eb6 100644 --- a/pym/repoman/scanner.py +++ b/pym/repoman/scanner.py @@ -290,6 +290,7 @@ class Scanner(object): ('mtime', 'MtimeChecks'), ('multicheck', 'MultiCheck'), # Options.is_forced() is used to bypass further checks ('options', 'Options'), ('profile', 'ProfileDependsChecks'), + ('unknown', 'DependUnknown'), ]: if mod[0]: mod_class = MODULE_CONTROLLER.get_class(mod[0]) @@ -317,15 +318,6 @@ class Scanner(object): if y_ebuild_continue: continue - if not dynamic_data['baddepsyntax'] and dynamic_data['unknown_pkgs']: - type_map = {} - for mytype, atom in dynamic_data['unknown_pkgs']: - type_map.setdefault(mytype, set()).add(atom) - for mytype, atoms in type_map.items(): - self.qatracker.add_error( - "dependency.unknown", "%s: %s: %s" - % (dynamic_data['ebuild'].relative_path, mytype, ", ".join(sorted(atoms)))) - # check if there are unused local USE-descriptions in metadata.xml # (unless there are any invalids, to avoid noise) if dynamic_data['allvalid']: