* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/scan/ebuild/, ...
@ 2017-07-10 17:52 Brian Dolbec
0 siblings, 0 replies; 2+ messages in thread
From: Brian Dolbec @ 2017-07-10 17:52 UTC (permalink / raw
To: gentoo-commits
commit: 0f7614d8152d8f1b30862d847afbac1ee4bd7de0
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 10 17:35:08 2017 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Jul 10 17:50:19 2017 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=0f7614d8
repoman: modules/scan/*: Add module_runsIn spec variable
This variable will be used to help determine which process loops
to run the modules in. This is summary data taken from the runIn*()'s
defined in the target eclasses containing the checks.
repoman/pym/repoman/modules/scan/depend/__init__.py | 1 +
repoman/pym/repoman/modules/scan/directories/__init__.py | 2 ++
repoman/pym/repoman/modules/scan/eapi/__init__.py | 1 +
repoman/pym/repoman/modules/scan/ebuild/__init__.py | 2 ++
repoman/pym/repoman/modules/scan/eclasses/__init__.py | 2 ++
repoman/pym/repoman/modules/scan/fetch/__init__.py | 1 +
repoman/pym/repoman/modules/scan/keywords/__init__.py | 1 +
repoman/pym/repoman/modules/scan/manifest/__init__.py | 1 +
repoman/pym/repoman/modules/scan/metadata/__init__.py | 4 ++++
repoman/pym/repoman/modules/scan/options/__init__.py | 1 +
10 files changed, 16 insertions(+)
diff --git a/repoman/pym/repoman/modules/scan/depend/__init__.py b/repoman/pym/repoman/modules/scan/depend/__init__.py
index 6d1228601..bd6905c0b 100644
--- a/repoman/pym/repoman/modules/scan/depend/__init__.py
+++ b/repoman/pym/repoman/modules/scan/depend/__init__.py
@@ -26,6 +26,7 @@ module_spec = {
'ebuild': (None, None),
'pkg': (None, None),
},
+ 'module_runsIn': ['ebuilds'],
},
}
}
diff --git a/repoman/pym/repoman/modules/scan/directories/__init__.py b/repoman/pym/repoman/modules/scan/directories/__init__.py
index 47834cb40..18ca086ce 100644
--- a/repoman/pym/repoman/modules/scan/directories/__init__.py
+++ b/repoman/pym/repoman/modules/scan/directories/__init__.py
@@ -26,6 +26,7 @@ module_spec = {
'checkdirlist': (None, None),
'checkdir_relative': (None, None),
},
+ 'module_runsIn': ['pkgs'],
},
'mtime-module': {
'name': "mtime",
@@ -42,6 +43,7 @@ module_spec = {
'ebuild': (None, None),
'pkg': (None, None),
},
+ 'module_runsIn': ['ebuilds'],
},
}
}
diff --git a/repoman/pym/repoman/modules/scan/eapi/__init__.py b/repoman/pym/repoman/modules/scan/eapi/__init__.py
index 4c3dd6e8f..f6306b3e1 100644
--- a/repoman/pym/repoman/modules/scan/eapi/__init__.py
+++ b/repoman/pym/repoman/modules/scan/eapi/__init__.py
@@ -23,6 +23,7 @@ module_spec = {
'func_kwargs': {
'ebuild': (None, None),
},
+ 'module_runsIn': ['ebuilds'],
},
}
}
diff --git a/repoman/pym/repoman/modules/scan/ebuild/__init__.py b/repoman/pym/repoman/modules/scan/ebuild/__init__.py
index 8666e78c2..3e1d31951 100644
--- a/repoman/pym/repoman/modules/scan/ebuild/__init__.py
+++ b/repoman/pym/repoman/modules/scan/ebuild/__init__.py
@@ -37,6 +37,7 @@ module_spec = {
'xpkg': (None, None),
'y_ebuild': (None, None),
},
+ 'module_runsIn': ['pkgs', 'ebuilds'],
},
'multicheck-module': {
'name': "multicheck",
@@ -52,6 +53,7 @@ module_spec = {
'ebuild': (None, None),
'pkg': (None, None),
},
+ 'module_runsIn': ['ebuilds'],
},
}
}
diff --git a/repoman/pym/repoman/modules/scan/eclasses/__init__.py b/repoman/pym/repoman/modules/scan/eclasses/__init__.py
index 01bd29adf..9b1f203ce 100644
--- a/repoman/pym/repoman/modules/scan/eclasses/__init__.py
+++ b/repoman/pym/repoman/modules/scan/eclasses/__init__.py
@@ -26,6 +26,7 @@ module_spec = {
'xpkg': (None, None),
'y_ebuild': (None, None),
},
+ 'module_runsIn': ['ebuilds'],
},
'ruby-module': {
'name': "ruby",
@@ -41,6 +42,7 @@ module_spec = {
'ebuild': (None, None),
'pkg': (None, None),
},
+ 'module_runsIn': ['ebuilds'],
},
}
}
diff --git a/repoman/pym/repoman/modules/scan/fetch/__init__.py b/repoman/pym/repoman/modules/scan/fetch/__init__.py
index 3c8e6002c..d1b4f8d0e 100644
--- a/repoman/pym/repoman/modules/scan/fetch/__init__.py
+++ b/repoman/pym/repoman/modules/scan/fetch/__init__.py
@@ -27,6 +27,7 @@ module_spec = {
'ebuild': (None, None),
'xpkg': (None, None),
},
+ 'module_runsIn': ['pkgs', 'ebuilds'],
},
}
}
diff --git a/repoman/pym/repoman/modules/scan/keywords/__init__.py b/repoman/pym/repoman/modules/scan/keywords/__init__.py
index 2223927c8..88ea5aca9 100644
--- a/repoman/pym/repoman/modules/scan/keywords/__init__.py
+++ b/repoman/pym/repoman/modules/scan/keywords/__init__.py
@@ -27,6 +27,7 @@ module_spec = {
'xpkg': None,
'y_ebuild': (None, None),
},
+ 'module_runsIn': ['pkgs', 'ebuilds', 'final'],
},
}
}
diff --git a/repoman/pym/repoman/modules/scan/manifest/__init__.py b/repoman/pym/repoman/modules/scan/manifest/__init__.py
index dca431b62..94f0a1f35 100644
--- a/repoman/pym/repoman/modules/scan/manifest/__init__.py
+++ b/repoman/pym/repoman/modules/scan/manifest/__init__.py
@@ -24,6 +24,7 @@ module_spec = {
'checkdir': (None, None),
'xpkg': (None, None),
},
+ 'module_runsIn': ['pkgs'],
},
}
}
diff --git a/repoman/pym/repoman/modules/scan/metadata/__init__.py b/repoman/pym/repoman/modules/scan/metadata/__init__.py
index 8e6668b10..03548d164 100644
--- a/repoman/pym/repoman/modules/scan/metadata/__init__.py
+++ b/repoman/pym/repoman/modules/scan/metadata/__init__.py
@@ -31,6 +31,7 @@ module_spec = {
'xpkg': (None, None),
'y_ebuild': (None, None),
},
+ 'module_runsIn': ['pkgs', 'ebuilds', 'final'],
},
'ebuild-metadata': {
'name': "ebuild_metadata",
@@ -48,6 +49,7 @@ module_spec = {
'xpkg': (None, None),
'y_ebuild': (None, None),
},
+ 'module_runsIn': ['ebuilds'],
},
'description-metadata': {
'name': "description",
@@ -63,6 +65,7 @@ module_spec = {
'ebuild': (None, None),
'pkg': ('Future', 'UNSET'),
},
+ 'module_runsIn': ['ebuilds'],
},
'restrict-metadata': {
'name': "restrict",
@@ -79,6 +82,7 @@ module_spec = {
'xpkg': (None, None),
'y_ebuild': (None, None),
},
+ 'module_runsIn': ['ebuilds'],
},
}
}
diff --git a/repoman/pym/repoman/modules/scan/options/__init__.py b/repoman/pym/repoman/modules/scan/options/__init__.py
index a5746ce67..d62e75274 100644
--- a/repoman/pym/repoman/modules/scan/options/__init__.py
+++ b/repoman/pym/repoman/modules/scan/options/__init__.py
@@ -22,6 +22,7 @@ module_spec = {
],
'func_kwargs': {
},
+ 'module_runsIn': ['ebuilds'],
},
}
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/scan/ebuild/, ...
@ 2017-07-10 22:31 Brian Dolbec
0 siblings, 0 replies; 2+ messages in thread
From: Brian Dolbec @ 2017-07-10 22:31 UTC (permalink / raw
To: gentoo-commits
commit: 6848f27e23b74625d5473c183dda226186e695a6
Author: Brian Dolbec <bdolbec <AT> gaikai <DOT> com>
AuthorDate: Tue Jun 27 17:56:09 2017 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Jul 10 22:29:33 2017 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=6848f27e
repoman: Update modules for the new QAData class
Rather than direct import, now the QAData instance is accessed via
repo_settings. Add repo_settings need to all modules requiring QAData
access.
repoman/pym/repoman/modules/scan/depend/_depend_checks.py | 9 ++++-----
repoman/pym/repoman/modules/scan/depend/profile.py | 3 ++-
repoman/pym/repoman/modules/scan/ebuild/ebuild.py | 5 +++--
repoman/pym/repoman/modules/scan/eclasses/__init__.py | 2 +-
repoman/pym/repoman/modules/scan/eclasses/ruby.py | 5 +++--
repoman/pym/repoman/modules/scan/metadata/__init__.py | 4 ++--
repoman/pym/repoman/modules/scan/metadata/description.py | 6 +++---
repoman/pym/repoman/modules/scan/metadata/ebuild_metadata.py | 6 +++---
repoman/pym/repoman/modules/scan/metadata/restrict.py | 4 ++--
9 files changed, 23 insertions(+), 21 deletions(-)
diff --git a/repoman/pym/repoman/modules/scan/depend/_depend_checks.py b/repoman/pym/repoman/modules/scan/depend/_depend_checks.py
index 11435f99e..cffacc55e 100644
--- a/repoman/pym/repoman/modules/scan/depend/_depend_checks.py
+++ b/repoman/pym/repoman/modules/scan/depend/_depend_checks.py
@@ -9,7 +9,6 @@ from portage.dep import Atom
from repoman.check_missingslot import check_missingslot
# import our initialized portage instance
from repoman._portage import portage
-from repoman.qa_data import suspect_virtual, suspect_rdepend
def check_slotop(depstr, is_valid_flag, badsyntax, mytype,
qatracker, relative_path):
@@ -51,7 +50,7 @@ def check_slotop(depstr, is_valid_flag, badsyntax, mytype,
_traverse_tree(branch, in_any_of=in_any_of)
_traverse_tree(my_dep_tree, False)
-def _depend_checks(ebuild, pkg, portdb, qatracker, repo_metadata):
+def _depend_checks(ebuild, pkg, portdb, qatracker, repo_metadata, qadata):
'''Checks the ebuild dependencies for errors
@param pkg: Package in which we check (object).
@@ -111,11 +110,11 @@ def _depend_checks(ebuild, pkg, portdb, qatracker, repo_metadata):
if pkg.category != "virtual":
if not is_blocker and \
- atom.cp in suspect_virtual:
+ atom.cp in qadata.suspect_virtual:
qatracker.add_error(
'virtual.suspect', ebuild.relative_path +
": %s: consider using '%s' instead of '%s'" %
- (mytype, suspect_virtual[atom.cp], atom))
+ (mytype, qadata.suspect_virtual[atom.cp], atom))
if not is_blocker and \
atom.cp.startswith("perl-core/"):
qatracker.add_error('dependency.perlcore',
@@ -141,7 +140,7 @@ def _depend_checks(ebuild, pkg, portdb, qatracker, repo_metadata):
" wxwidgets.eclass" % (ebuild.relative_path, mytype))
elif runtime:
if not is_blocker and \
- atom.cp in suspect_rdepend:
+ atom.cp in qadata.suspect_rdepend:
qatracker.add_error(
mytype + '.suspect',
ebuild.relative_path + ": '%s'" % atom)
diff --git a/repoman/pym/repoman/modules/scan/depend/profile.py b/repoman/pym/repoman/modules/scan/depend/profile.py
index cf3d9a8f4..1adda44bb 100644
--- a/repoman/pym/repoman/modules/scan/depend/profile.py
+++ b/repoman/pym/repoman/modules/scan/depend/profile.py
@@ -63,7 +63,8 @@ class ProfileDependsChecks(ScanBase):
ebuild = kwargs.get('ebuild').get()
pkg = kwargs.get('pkg').get()
unknown_pkgs, baddepsyntax = _depend_checks(
- ebuild, pkg, self.portdb, self.qatracker, self.repo_metadata)
+ ebuild, pkg, self.portdb, self.qatracker, self.repo_metadata,
+ self.repo_settings.qadata)
relevant_profiles = []
for keyword, arch, groups in _gen_arches(ebuild, self.options,
diff --git a/repoman/pym/repoman/modules/scan/ebuild/ebuild.py b/repoman/pym/repoman/modules/scan/ebuild/ebuild.py
index 28cb8b407..d2715bc6e 100644
--- a/repoman/pym/repoman/modules/scan/ebuild/ebuild.py
+++ b/repoman/pym/repoman/modules/scan/ebuild/ebuild.py
@@ -9,7 +9,6 @@ from _emerge.Package import Package
from _emerge.RootConfig import RootConfig
from repoman.modules.scan.scanbase import ScanBase
-from repoman.qa_data import no_exec, allvars
# import our initialized portage instance
from repoman._portage import portage
from portage import os
@@ -178,7 +177,8 @@ class Ebuild(ScanBase):
pkgs = {}
for y in checkdirlist:
file_is_ebuild = y.endswith(".ebuild")
- file_should_be_non_executable = y in no_exec or file_is_ebuild
+ file_should_be_non_executable = (
+ y in self.repo_settings.qadata.no_exec or file_is_ebuild)
if file_should_be_non_executable:
file_is_executable = stat.S_IMODE(
@@ -191,6 +191,7 @@ class Ebuild(ScanBase):
ebuildlist.append(pf)
catdir = xpkg.split("/")[0]
cpv = "%s/%s" % (catdir, pf)
+ allvars = self.repo_settings.qadata.allvars
try:
myaux = dict(zip(allvars, self.portdb.aux_get(cpv, allvars)))
except KeyError:
diff --git a/repoman/pym/repoman/modules/scan/eclasses/__init__.py b/repoman/pym/repoman/modules/scan/eclasses/__init__.py
index 78d46e4b4..01bd29adf 100644
--- a/repoman/pym/repoman/modules/scan/eclasses/__init__.py
+++ b/repoman/pym/repoman/modules/scan/eclasses/__init__.py
@@ -35,7 +35,7 @@ module_spec = {
'functions': ['check'],
'func_kwargs': {
},
- 'mod_kwargs': ['qatracker'
+ 'mod_kwargs': ['qatracker', 'repo_settings'
],
'func_kwargs': {
'ebuild': (None, None),
diff --git a/repoman/pym/repoman/modules/scan/eclasses/ruby.py b/repoman/pym/repoman/modules/scan/eclasses/ruby.py
index b3501805e..c5adeedf1 100644
--- a/repoman/pym/repoman/modules/scan/eclasses/ruby.py
+++ b/repoman/pym/repoman/modules/scan/eclasses/ruby.py
@@ -3,7 +3,6 @@
Performs Ruby eclass checks
'''
-from repoman.qa_data import ruby_deprecated
from repoman.modules.scan.scanbase import ScanBase
@@ -16,6 +15,7 @@ class RubyEclassChecks(ScanBase):
'''
super(RubyEclassChecks, self).__init__(**kwargs)
self.qatracker = kwargs.get('qatracker')
+ self.repo_settings = kwargs.get('repo_settings')
self.old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
def check(self, **kwargs):
@@ -32,7 +32,8 @@ class RubyEclassChecks(ScanBase):
is_inherited, self.old_ruby_eclasses)
if is_old_ruby_eclass_inherited:
- ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
+ ruby_intersection = pkg.iuse.all.intersection(
+ self.repo_settings.qadata.ruby_deprecated)
if ruby_intersection:
for myruby in ruby_intersection:
diff --git a/repoman/pym/repoman/modules/scan/metadata/__init__.py b/repoman/pym/repoman/modules/scan/metadata/__init__.py
index b656d7af0..8e6668b10 100644
--- a/repoman/pym/repoman/modules/scan/metadata/__init__.py
+++ b/repoman/pym/repoman/modules/scan/metadata/__init__.py
@@ -40,7 +40,7 @@ module_spec = {
'functions': ['check'],
'func_desc': {
},
- 'mod_kwargs': ['qatracker',
+ 'mod_kwargs': ['qatracker', 'repo_settings',
],
'func_kwargs': {
'catdir': (None, None),
@@ -57,7 +57,7 @@ module_spec = {
'functions': ['check'],
'func_desc': {
},
- 'mod_kwargs': ['qatracker',
+ 'mod_kwargs': ['qatracker', 'repo_settings'
],
'func_kwargs': {
'ebuild': (None, None),
diff --git a/repoman/pym/repoman/modules/scan/metadata/description.py b/repoman/pym/repoman/modules/scan/metadata/description.py
index 79f62e1de..0ce81a2dc 100644
--- a/repoman/pym/repoman/modules/scan/metadata/description.py
+++ b/repoman/pym/repoman/modules/scan/metadata/description.py
@@ -4,7 +4,6 @@ Perform checks on the DESCRIPTION variable.
'''
from repoman.modules.scan.scanbase import ScanBase
-from repoman.qa_data import max_desc_len
class DescriptionChecks(ScanBase):
@@ -15,6 +14,7 @@ class DescriptionChecks(ScanBase):
@param qatracker: QATracker instance
'''
self.qatracker = kwargs.get('qatracker')
+ self.repo_settings = kwargs.get('repo_settings')
def checkTooLong(self, **kwargs):
'''
@@ -24,12 +24,12 @@ class DescriptionChecks(ScanBase):
ebuild = kwargs.get('ebuild').get()
pkg = kwargs.get('pkg').get()
# 14 is the length of DESCRIPTION=""
- if len(pkg._metadata['DESCRIPTION']) > max_desc_len:
+ if len(pkg._metadata['DESCRIPTION']) > self.repo_settings.qadata.max_desc_len:
self.qatracker.add_error(
'DESCRIPTION.toolong',
"%s: DESCRIPTION is %d characters (max %d)" %
(ebuild.relative_path, len(
- pkg._metadata['DESCRIPTION']), max_desc_len))
+ pkg._metadata['DESCRIPTION']), self.repo_settings.qadata.max_desc_len))
return False
@property
diff --git a/repoman/pym/repoman/modules/scan/metadata/ebuild_metadata.py b/repoman/pym/repoman/modules/scan/metadata/ebuild_metadata.py
index cba8ec5e2..2208047ce 100644
--- a/repoman/pym/repoman/modules/scan/metadata/ebuild_metadata.py
+++ b/repoman/pym/repoman/modules/scan/metadata/ebuild_metadata.py
@@ -9,7 +9,6 @@ if sys.hexversion >= 0x3000000:
basestring = str
from repoman.modules.scan.scanbase import ScanBase
-from repoman.qa_data import missingvars
from portage.dep import use_reduce
@@ -20,6 +19,7 @@ class EbuildMetadata(ScanBase):
def __init__(self, **kwargs):
self.qatracker = kwargs.get('qatracker')
+ self.repo_settings = kwargs.get('repo_settings')
def invalidchar(self, **kwargs):
ebuild = kwargs.get('ebuild').get()
@@ -37,14 +37,14 @@ class EbuildMetadata(ScanBase):
def missing(self, **kwargs):
ebuild = kwargs.get('ebuild').get()
- for pos, missing_var in enumerate(missingvars):
+ for pos, missing_var in enumerate(self.repo_settings.qadata.missingvars):
if not ebuild.metadata.get(missing_var):
if kwargs.get('catdir') == "virtual" and \
missing_var in ("HOMEPAGE", "LICENSE"):
continue
if ebuild.live_ebuild and missing_var == "KEYWORDS":
continue
- myqakey = missingvars[pos] + ".missing"
+ myqakey = self.repo_settings.qadata.missingvars[pos] + ".missing"
self.qatracker.add_error(myqakey, '%s/%s.ebuild'
% (kwargs.get('xpkg'), kwargs.get('y_ebuild')))
return False
diff --git a/repoman/pym/repoman/modules/scan/metadata/restrict.py b/repoman/pym/repoman/modules/scan/metadata/restrict.py
index 0f9c5e52e..99784f231 100644
--- a/repoman/pym/repoman/modules/scan/metadata/restrict.py
+++ b/repoman/pym/repoman/modules/scan/metadata/restrict.py
@@ -7,7 +7,6 @@ Perform checks on the RESTRICT variable.
from repoman._portage import portage
from repoman.modules.scan.scanbase import ScanBase
-from repoman.qa_data import valid_restrict
class RestrictChecks(ScanBase):
@@ -18,6 +17,7 @@ class RestrictChecks(ScanBase):
@param qatracker: QATracker instance
'''
self.qatracker = kwargs.get('qatracker')
+ self.repo_settings = kwargs.get('repo_settings')
def check(self, **kwargs):
xpkg = kwargs.get('xpkg')
@@ -35,7 +35,7 @@ class RestrictChecks(ScanBase):
if myrestrict:
myrestrict = set(myrestrict)
- mybadrestrict = myrestrict.difference(valid_restrict)
+ mybadrestrict = myrestrict.difference(self.repo_settings.qadata.valid_restrict)
if mybadrestrict:
for mybad in mybadrestrict:
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-10 22:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-10 17:52 [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/scan/ebuild/, Brian Dolbec
-- strict thread matches above, loose matches on Subject: below --
2017-07-10 22:31 Brian Dolbec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox