commit:     593ee3f398b7a49a6e3377475a05e21d0925da99
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  3 21:19:59 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Jan 10 22:59:35 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=593ee3f3

repoman: Migrate some additional Dependency code to the plugin

 pym/repoman/modules/scan/depend/depend.py | 13 ++++++++++++-
 pym/repoman/scanner.py                    | 22 +++-------------------
 2 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/pym/repoman/modules/scan/depend/depend.py 
b/pym/repoman/modules/scan/depend/depend.py
index 8a0ff48..7f1d007 100644
--- a/pym/repoman/modules/scan/depend/depend.py
+++ b/pym/repoman/modules/scan/depend/depend.py
@@ -1,3 +1,5 @@
+# -*- coding:utf-8 -*-
+
 
 from _emerge.Package import Package
 
@@ -121,7 +123,16 @@ class DependChecks(object):
                                qacat = m + ".syntax"
                        self.qatracker.add_error(
                                qacat, "%s: %s: %s" % (ebuild.relative_path, m, 
b))
-               return {'continue': False, 'unknown_pkgs': unknown_pkgs, 
'type_list': type_list}
+
+               # 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 = badlicsyntax > 0
+               #badprovsyntax = badprovsyntax > 0
+
+               return {'continue': False, 'unknown_pkgs': unknown_pkgs, 
'type_list': type_list,
+                       'badlicsyntax': badlicsyntax, 'baddepsyntax': 
baddepsyntax}
 
        @property
        def runInPkgs(self):

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index d42fd33..6d5416b 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -324,26 +324,10 @@ class Scanner(object):
                        if y_ebuild_continue:
                                continue
 
-                       if dynamic_data['live_ebuild'] and 
self.repo_settings.repo_config.name == "gentoo":
-                               self.liveeclasscheck.check(
-                                       dynamic_data['pkg'], xpkg, 
dynamic_data['ebuild'], y_ebuild, dynamic_data['ebuild'].keywords, 
self.repo_metadata['pmaskdict'])
-
-                       unknown_pkgs = set()
-                       baddepsyntax = False
-                       badlicsyntax = False
-                       badprovsyntax = False
-                       # catpkg = catdir + "/" + y_ebuild
-
-                       badlicsyntax = len([z for z in 
dynamic_data['type_list'] if z == "LICENSE"])
-                       badprovsyntax = len([z for z in 
dynamic_data['type_list'] if z == "PROVIDE"])
-                       baddepsyntax = len(dynamic_data['type_list']) != 
badlicsyntax + badprovsyntax
-                       badlicsyntax = badlicsyntax > 0
-                       badprovsyntax = badprovsyntax > 0
-
                        used_useflags = 
used_useflags.union(dynamic_data['ebuild_UsedUseFlags'])
 
                        # license checks
-                       if not badlicsyntax:
+                       if not dynamic_data['badlicsyntax']:
                                self.licensecheck.check(dynamic_data['pkg'], 
xpkg, dynamic_data['ebuild'], y_ebuild)
 
                        self.restrictcheck.check(dynamic_data['pkg'], xpkg, 
dynamic_data['ebuild'], y_ebuild)
@@ -449,7 +433,7 @@ class Scanner(object):
                                dep_settings.usemask = 
dep_settings._use_manager.getUseMask(
                                        dynamic_data['pkg'], 
stable=dep_settings._parent_stable)
 
-                               if not baddepsyntax:
+                               if not dynamic_data['baddepsyntax']:
                                        ismasked = not 
dynamic_data['ebuild'].archs or \
                                                dynamic_data['pkg'].cpv not in 
self.portdb.xmatch("match-visible",
                                                Atom("%s::%s" % 
(dynamic_data['pkg'].cp, self.repo_settings.repo_config.name)))
@@ -539,7 +523,7 @@ class Scanner(object):
                                                                        % 
(dynamic_data['ebuild'].relative_path, mytype, keyword,
                                                                                
prof, pformat(atoms, indent=6)))
 
-                       if not baddepsyntax and dynamic_data['unknown_pkgs']:
+                       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)

Reply via email to