[gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/, repoman/pym/repoman/modules/scan/ebuild/
commit: 0e6a9c7e274d9eba6ca98aedb239bf9e7cc8e7f5 Author: Brian Dolbec gentoo org> AuthorDate: Sat Jul 15 01:09:03 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Wed Dec 6 00:13:28 2017 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=0e6a9c7e repoman: Convert multicheck module to the new linechecks sub-module repoman/pym/repoman/modules/scan/ebuild/__init__.py | 2 +- repoman/pym/repoman/modules/scan/ebuild/multicheck.py | 10 +++--- repoman/pym/repoman/scanner.py| 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/repoman/pym/repoman/modules/scan/ebuild/__init__.py b/repoman/pym/repoman/modules/scan/ebuild/__init__.py index 3e1d31951..1d8ec1941 100644 --- a/repoman/pym/repoman/modules/scan/ebuild/__init__.py +++ b/repoman/pym/repoman/modules/scan/ebuild/__init__.py @@ -47,7 +47,7 @@ module_spec = { 'functions': ['check'], 'func_kwargs': { }, - 'mod_kwargs': ['qatracker', 'options' + 'mod_kwargs': ['qatracker', 'options', 'repo_settings', 'linechecks', ], 'func_kwargs': { 'ebuild': (None, None), diff --git a/repoman/pym/repoman/modules/scan/ebuild/multicheck.py b/repoman/pym/repoman/modules/scan/ebuild/multicheck.py index 9e36e2a68..94526ae9e 100644 --- a/repoman/pym/repoman/modules/scan/ebuild/multicheck.py +++ b/repoman/pym/repoman/modules/scan/ebuild/multicheck.py @@ -8,7 +8,7 @@ import io from portage import _encodings, _unicode_encode from repoman.modules.scan.scanbase import ScanBase -from .checks import run_checks, checks_init +from repoman.modules.linechecks.controller import LineCheckController class MultiCheck(ScanBase): @@ -22,7 +22,11 @@ class MultiCheck(ScanBase): ''' self.qatracker = kwargs.get('qatracker') self.options = kwargs.get('options') - checks_init(self.options.experimental_inherit == 'y') + self.controller = LineCheckController( + kwargs.get('repo_settings'), + kwargs.get('linechecks') + ) + self.controller.checks_init(self.options.experimental_inherit == 'y') def check(self, **kwargs): '''Check the ebuild for utf-8 encoding @@ -40,7 +44,7 @@ class MultiCheck(ScanBase): errors='strict'), mode='r', encoding=_encodings['repo.content']) try: - for check_name, e in run_checks(f, pkg): + for check_name, e in self.controller.run_checks(f, pkg): self.qatracker.add_error( check_name, ebuild.relative_path + ': %s' % e) finally: diff --git a/repoman/pym/repoman/scanner.py b/repoman/pym/repoman/scanner.py index b3d030570..d61e50131 100644 --- a/repoman/pym/repoman/scanner.py +++ b/repoman/pym/repoman/scanner.py @@ -193,6 +193,7 @@ class Scanner(object): "env": self.env, "have": self.have, "dev_keywords": self.dev_keywords, + "linechecks": self.moduleconfig.linechecks, } # initialize the plugin checks here self.modules = {}
[gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/, repoman/pym/repoman/modules/scan/ebuild/
commit: 5bae7afe1bf95a57a4ec135137a66a4f3047143e Author: Brian Dolbec gentoo org> AuthorDate: Sat Jul 15 01:09:03 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Tue Dec 5 18:24:49 2017 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=5bae7afe repoman: Convert multicheck module to the new linechecks sub-module repoman/pym/repoman/modules/scan/ebuild/__init__.py | 2 +- repoman/pym/repoman/modules/scan/ebuild/multicheck.py | 10 +++--- repoman/pym/repoman/scanner.py| 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/repoman/pym/repoman/modules/scan/ebuild/__init__.py b/repoman/pym/repoman/modules/scan/ebuild/__init__.py index 3e1d31951..1d8ec1941 100644 --- a/repoman/pym/repoman/modules/scan/ebuild/__init__.py +++ b/repoman/pym/repoman/modules/scan/ebuild/__init__.py @@ -47,7 +47,7 @@ module_spec = { 'functions': ['check'], 'func_kwargs': { }, - 'mod_kwargs': ['qatracker', 'options' + 'mod_kwargs': ['qatracker', 'options', 'repo_settings', 'linechecks', ], 'func_kwargs': { 'ebuild': (None, None), diff --git a/repoman/pym/repoman/modules/scan/ebuild/multicheck.py b/repoman/pym/repoman/modules/scan/ebuild/multicheck.py index 9e36e2a68..94526ae9e 100644 --- a/repoman/pym/repoman/modules/scan/ebuild/multicheck.py +++ b/repoman/pym/repoman/modules/scan/ebuild/multicheck.py @@ -8,7 +8,7 @@ import io from portage import _encodings, _unicode_encode from repoman.modules.scan.scanbase import ScanBase -from .checks import run_checks, checks_init +from repoman.modules.linechecks.controller import LineCheckController class MultiCheck(ScanBase): @@ -22,7 +22,11 @@ class MultiCheck(ScanBase): ''' self.qatracker = kwargs.get('qatracker') self.options = kwargs.get('options') - checks_init(self.options.experimental_inherit == 'y') + self.controller = LineCheckController( + kwargs.get('repo_settings'), + kwargs.get('linechecks') + ) + self.controller.checks_init(self.options.experimental_inherit == 'y') def check(self, **kwargs): '''Check the ebuild for utf-8 encoding @@ -40,7 +44,7 @@ class MultiCheck(ScanBase): errors='strict'), mode='r', encoding=_encodings['repo.content']) try: - for check_name, e in run_checks(f, pkg): + for check_name, e in self.controller.run_checks(f, pkg): self.qatracker.add_error( check_name, ebuild.relative_path + ': %s' % e) finally: diff --git a/repoman/pym/repoman/scanner.py b/repoman/pym/repoman/scanner.py index b3d030570..d61e50131 100644 --- a/repoman/pym/repoman/scanner.py +++ b/repoman/pym/repoman/scanner.py @@ -193,6 +193,7 @@ class Scanner(object): "env": self.env, "have": self.have, "dev_keywords": self.dev_keywords, + "linechecks": self.moduleconfig.linechecks, } # initialize the plugin checks here self.modules = {}
[gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/, repoman/pym/repoman/modules/scan/ebuild/
commit: 2f29a41f0bf42058a6f7c2c44b2eaf779fe9d1e0 Author: Brian Dolbec gentoo org> AuthorDate: Sat Jul 15 01:09:03 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Sun Nov 26 17:32:20 2017 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=2f29a41f repoman: Convert multicheck module to the new linechecks sub-module repoman/pym/repoman/modules/scan/ebuild/__init__.py | 2 +- repoman/pym/repoman/modules/scan/ebuild/multicheck.py | 10 +++--- repoman/pym/repoman/scanner.py| 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/repoman/pym/repoman/modules/scan/ebuild/__init__.py b/repoman/pym/repoman/modules/scan/ebuild/__init__.py index 3e1d31951..1d8ec1941 100644 --- a/repoman/pym/repoman/modules/scan/ebuild/__init__.py +++ b/repoman/pym/repoman/modules/scan/ebuild/__init__.py @@ -47,7 +47,7 @@ module_spec = { 'functions': ['check'], 'func_kwargs': { }, - 'mod_kwargs': ['qatracker', 'options' + 'mod_kwargs': ['qatracker', 'options', 'repo_settings', 'linechecks', ], 'func_kwargs': { 'ebuild': (None, None), diff --git a/repoman/pym/repoman/modules/scan/ebuild/multicheck.py b/repoman/pym/repoman/modules/scan/ebuild/multicheck.py index 9e36e2a68..94526ae9e 100644 --- a/repoman/pym/repoman/modules/scan/ebuild/multicheck.py +++ b/repoman/pym/repoman/modules/scan/ebuild/multicheck.py @@ -8,7 +8,7 @@ import io from portage import _encodings, _unicode_encode from repoman.modules.scan.scanbase import ScanBase -from .checks import run_checks, checks_init +from repoman.modules.linechecks.controller import LineCheckController class MultiCheck(ScanBase): @@ -22,7 +22,11 @@ class MultiCheck(ScanBase): ''' self.qatracker = kwargs.get('qatracker') self.options = kwargs.get('options') - checks_init(self.options.experimental_inherit == 'y') + self.controller = LineCheckController( + kwargs.get('repo_settings'), + kwargs.get('linechecks') + ) + self.controller.checks_init(self.options.experimental_inherit == 'y') def check(self, **kwargs): '''Check the ebuild for utf-8 encoding @@ -40,7 +44,7 @@ class MultiCheck(ScanBase): errors='strict'), mode='r', encoding=_encodings['repo.content']) try: - for check_name, e in run_checks(f, pkg): + for check_name, e in self.controller.run_checks(f, pkg): self.qatracker.add_error( check_name, ebuild.relative_path + ': %s' % e) finally: diff --git a/repoman/pym/repoman/scanner.py b/repoman/pym/repoman/scanner.py index b3d030570..d61e50131 100644 --- a/repoman/pym/repoman/scanner.py +++ b/repoman/pym/repoman/scanner.py @@ -193,6 +193,7 @@ class Scanner(object): "env": self.env, "have": self.have, "dev_keywords": self.dev_keywords, + "linechecks": self.moduleconfig.linechecks, } # initialize the plugin checks here self.modules = {}
[gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/, repoman/pym/repoman/modules/scan/ebuild/
commit: 42b08308ce0c527fb85bed0a530cc54c5a901121 Author: Brian Dolbec gentoo org> AuthorDate: Sat Jul 15 01:09:03 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Mon Sep 11 16:13:17 2017 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=42b08308 repoman: Convert multicheck module to the new linechecks sub-module repoman/pym/repoman/modules/scan/ebuild/__init__.py | 2 +- repoman/pym/repoman/modules/scan/ebuild/multicheck.py | 10 +++--- repoman/pym/repoman/scanner.py| 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/repoman/pym/repoman/modules/scan/ebuild/__init__.py b/repoman/pym/repoman/modules/scan/ebuild/__init__.py index 3e1d31951..1d8ec1941 100644 --- a/repoman/pym/repoman/modules/scan/ebuild/__init__.py +++ b/repoman/pym/repoman/modules/scan/ebuild/__init__.py @@ -47,7 +47,7 @@ module_spec = { 'functions': ['check'], 'func_kwargs': { }, - 'mod_kwargs': ['qatracker', 'options' + 'mod_kwargs': ['qatracker', 'options', 'repo_settings', 'linechecks', ], 'func_kwargs': { 'ebuild': (None, None), diff --git a/repoman/pym/repoman/modules/scan/ebuild/multicheck.py b/repoman/pym/repoman/modules/scan/ebuild/multicheck.py index 9e36e2a68..94526ae9e 100644 --- a/repoman/pym/repoman/modules/scan/ebuild/multicheck.py +++ b/repoman/pym/repoman/modules/scan/ebuild/multicheck.py @@ -8,7 +8,7 @@ import io from portage import _encodings, _unicode_encode from repoman.modules.scan.scanbase import ScanBase -from .checks import run_checks, checks_init +from repoman.modules.linechecks.controller import LineCheckController class MultiCheck(ScanBase): @@ -22,7 +22,11 @@ class MultiCheck(ScanBase): ''' self.qatracker = kwargs.get('qatracker') self.options = kwargs.get('options') - checks_init(self.options.experimental_inherit == 'y') + self.controller = LineCheckController( + kwargs.get('repo_settings'), + kwargs.get('linechecks') + ) + self.controller.checks_init(self.options.experimental_inherit == 'y') def check(self, **kwargs): '''Check the ebuild for utf-8 encoding @@ -40,7 +44,7 @@ class MultiCheck(ScanBase): errors='strict'), mode='r', encoding=_encodings['repo.content']) try: - for check_name, e in run_checks(f, pkg): + for check_name, e in self.controller.run_checks(f, pkg): self.qatracker.add_error( check_name, ebuild.relative_path + ': %s' % e) finally: diff --git a/repoman/pym/repoman/scanner.py b/repoman/pym/repoman/scanner.py index b3d030570..d61e50131 100644 --- a/repoman/pym/repoman/scanner.py +++ b/repoman/pym/repoman/scanner.py @@ -193,6 +193,7 @@ class Scanner(object): "env": self.env, "have": self.have, "dev_keywords": self.dev_keywords, + "linechecks": self.moduleconfig.linechecks, } # initialize the plugin checks here self.modules = {}
[gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/, repoman/pym/repoman/modules/scan/ebuild/
commit: 807bcf83eb8f6e3106f8bac0c8c37265c8db00c8 Author: Brian Dolbec gentoo org> AuthorDate: Sat Jul 15 01:09:03 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Jul 15 02:08:28 2017 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=807bcf83 repoman: Convert multicheck module to the new linechecks sub-module repoman/pym/repoman/modules/scan/ebuild/__init__.py | 2 +- repoman/pym/repoman/modules/scan/ebuild/multicheck.py | 10 +++--- repoman/pym/repoman/scanner.py| 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/repoman/pym/repoman/modules/scan/ebuild/__init__.py b/repoman/pym/repoman/modules/scan/ebuild/__init__.py index 3e1d31951..1d8ec1941 100644 --- a/repoman/pym/repoman/modules/scan/ebuild/__init__.py +++ b/repoman/pym/repoman/modules/scan/ebuild/__init__.py @@ -47,7 +47,7 @@ module_spec = { 'functions': ['check'], 'func_kwargs': { }, - 'mod_kwargs': ['qatracker', 'options' + 'mod_kwargs': ['qatracker', 'options', 'repo_settings', 'linechecks', ], 'func_kwargs': { 'ebuild': (None, None), diff --git a/repoman/pym/repoman/modules/scan/ebuild/multicheck.py b/repoman/pym/repoman/modules/scan/ebuild/multicheck.py index 9e36e2a68..94526ae9e 100644 --- a/repoman/pym/repoman/modules/scan/ebuild/multicheck.py +++ b/repoman/pym/repoman/modules/scan/ebuild/multicheck.py @@ -8,7 +8,7 @@ import io from portage import _encodings, _unicode_encode from repoman.modules.scan.scanbase import ScanBase -from .checks import run_checks, checks_init +from repoman.modules.linechecks.controller import LineCheckController class MultiCheck(ScanBase): @@ -22,7 +22,11 @@ class MultiCheck(ScanBase): ''' self.qatracker = kwargs.get('qatracker') self.options = kwargs.get('options') - checks_init(self.options.experimental_inherit == 'y') + self.controller = LineCheckController( + kwargs.get('repo_settings'), + kwargs.get('linechecks') + ) + self.controller.checks_init(self.options.experimental_inherit == 'y') def check(self, **kwargs): '''Check the ebuild for utf-8 encoding @@ -40,7 +44,7 @@ class MultiCheck(ScanBase): errors='strict'), mode='r', encoding=_encodings['repo.content']) try: - for check_name, e in run_checks(f, pkg): + for check_name, e in self.controller.run_checks(f, pkg): self.qatracker.add_error( check_name, ebuild.relative_path + ': %s' % e) finally: diff --git a/repoman/pym/repoman/scanner.py b/repoman/pym/repoman/scanner.py index b3d030570..d61e50131 100644 --- a/repoman/pym/repoman/scanner.py +++ b/repoman/pym/repoman/scanner.py @@ -193,6 +193,7 @@ class Scanner(object): "env": self.env, "have": self.have, "dev_keywords": self.dev_keywords, + "linechecks": self.moduleconfig.linechecks, } # initialize the plugin checks here self.modules = {}
[gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/, repoman/pym/repoman/modules/scan/
commit: f9f7ac40696420ea4b90988070bf2041f3ae7989 Author: Brian Dolbec gentoo org> AuthorDate: Mon Jul 10 17:39:04 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Mon Jul 10 23:00:26 2017 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=f9f7ac40 repoman: Create a new ModuleConfig class This class will load the module configuration data from the target repo. Move the Modules class handling code to this new class. Update scanner.py to use the new ModuleConfig class for Modules class calls. Move the hard-coded loop lists to use the ModuleConfig instance configure/dynamically determined lists. TODO: add masters inheritance config stacking. Signed-off-by: Brian Dolbec gentoo.org> repoman/pym/repoman/modules/scan/module.py | 84 ++ repoman/pym/repoman/scanner.py | 83 - 2 files changed, 118 insertions(+), 49 deletions(-) diff --git a/repoman/pym/repoman/modules/scan/module.py b/repoman/pym/repoman/modules/scan/module.py new file mode 100644 index 0..8119bcec3 --- /dev/null +++ b/repoman/pym/repoman/modules/scan/module.py @@ -0,0 +1,84 @@ + +''' +moudules/scan/module.py +Module loading and run list generator +''' + +import logging +import os +import yaml + +from portage.module import InvalidModuleName, Modules +from portage.util import stack_lists + +MODULES_PATH = os.path.dirname(__file__) +# initial development debug info +logging.debug("module path: %s", MODULES_PATH) + + +class ModuleConfig(object): + '''Holds the scan modules configuration information and + creates the ordered list of modulles to run''' + + def __init__(self, configpaths): + '''Module init + + @param configpaths: ordered list of filepaths to load + ''' + self.configpaths = configpaths + + self.controller = Modules(path=MODULES_PATH, namepath="repoman.modules.scan") + logging.debug("module_names: %s", self.controller.module_names) + + self._configs = None + self.enabled = [] + self.pkgs_loop = [] + self.ebuilds_loop = [] + self.final_loop = [] + self.modules_forced = ['ebuild', 'mtime'] + self.load_configs() + for loop in ['pkgs', 'ebuilds', 'final']: + logging.debug("ModuleConfig; Processing loop %s", loop) + setattr(self, '%s_loop' % loop, self._determine_list(loop)) + + + def load_configs(self, configpaths=None): + '''load the config files in order''' + if configpaths: + self.configpaths = configpaths + elif not self.configpaths: + logging.error("ModuleConfig; Error: No repository.yml files defined") + configs = [] + for path in self.configpaths: + logging.debug("ModuleConfig; Processing: %s", path) + if os.path.exists(path): + try: + with open(path, 'r') as inputfile: + configs.append(yaml.safe_load(inputfile.read())) + except IOError as error: + logging,error("Failed to load file: %s", inputfile) + logging.exception(error) + logging.debug("ModuleConfig; completed : %s", path) + logging.debug("ModuleConfig; new _configs: %s", configs) + self._configs = configs + + def _determine_list(self, loop): + '''Determine the ordered list from the config data and + the moule_runsIn value in the module_spec + + @returns: list of modules + ''' + lists = [c['modules'].split() for c in self._configs] + stacked = self.modules_forced + stack_lists(lists) + mlist = [] + try: + for mod in stacked: + logging.debug("ModuleConfig; checking loop %s, module: %s, in: %s", + loop, mod, self.controller.get_spec(mod, 'module_runsIn')) + if loop in self.controller.get_spec(mod, 'module_runsIn'): + mlist.append(mod) + except InvalidModuleName: + logging.error("ModuleConfig; unkown module: %s, skipping", mod) + + logging.debug("ModuleConfig; mlist: %s", mlist) + return mlist diff --git a/repoman/pym/repoman/scanner.py b/repoman/pym/repoman/scanner.py index e13d4f68b..ffce701be 100644 --- a/repoman/pym/repoman/scanner.py +++ b/repoman/pym/repoman/scanner.py @@ -15,20 +15,10 @@ from repoman.modules.commit import repochec
[gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/, repoman/pym/repoman/modules/scan/
commit: 3b4030e3e2f85bb92463dd89f9fa2f514a49b56a Author: Brian Dolbec gentoo org> AuthorDate: Mon Jul 10 17:39:04 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Mon Jul 10 17:50:19 2017 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=3b4030e3 repoman: Create a new ModuleConfig class This class will load the module configuration data from the target repo. Move the Modules class handling code to this new class. Update scanner.py to use the new ModuleConfig class for Modules class calls. Move the hard-coded loop lists to use the ModuleConfig instance configure/dynamically determined lists. TODO: add masters inheritance config stacking. repoman/pym/repoman/modules/scan/module.py | 84 ++ repoman/pym/repoman/scanner.py | 83 - 2 files changed, 118 insertions(+), 49 deletions(-) diff --git a/repoman/pym/repoman/modules/scan/module.py b/repoman/pym/repoman/modules/scan/module.py new file mode 100644 index 0..f7f135f73 --- /dev/null +++ b/repoman/pym/repoman/modules/scan/module.py @@ -0,0 +1,84 @@ + +''' +moudules/scan/module.py +Module loading and run list generator +''' + +import logging +import os +import yaml + +from portage.module import InvalidModuleName, Modules +from portage.util import stack_lists + +MODULES_PATH = os.path.dirname(__file__) +# initial development debug info +logging.debug("module path: %s", MODULES_PATH) + + +class ModuleConfig(object): + '''Holds the scan modules configuration information and + creates the ordered list of modulles to run''' + + def __init__(self, configpaths): + '''Module init + + @param configpaths: ordered list of filepaths to load + ''' + self.configpaths = configpaths + + self.controller = Modules(path=MODULES_PATH, namepath="repoman.modules.scan") + logging.debug("module_names: %s", self.controller.module_names) + + self._configs = None + self.enabled = [] + self.pkgs_loop = [] + self.ebuilds_loop = [] + self.final_loop = [] + self.modules_forced = ['ebuild', 'mtime'] + self.load_configs() + for loop in ['pkgs', 'ebuilds', 'final']: + logging.debug("ModuleConfig; Processing loop %s", loop) + setattr(self, '%s_loop' % loop, self._determine_list(loop)) + + + def load_configs(self, configpaths=None): + '''load the config files in order''' + if configpaths: + self.configpaths = configpaths + elif not self.configpaths: + logging.error("ModuleConfig; Error: No repository.yml files defined") + configs = [] + for path in self.configpaths: + logging.debug("ModuleConfig; Processing: %s", path) + if os.path.exists(path): + try: + with open(path, 'r') as inputfile: + configs.append(yaml.safe_load(inputfile.read())) + except IOError as error: + logging,error("Failed to load file: %s", inputfile) + logging.exception(error) + logging.debug("ModuleConfig; completed : %s", path) + logging.debug("ModuleConfig; new _configs: %s", configs) + self._configs = configs + + def _determine_list(self, loop): + '''Determine the ordered list from the config data and + the moule_runsIn value in the module_spec + + @returns: list of modules + ''' + lists = [c['modules'] for c in self._configs] + stacked = self.modules_forced + stack_lists(lists) + mlist = [] + try: + for mod in stacked: + logging.debug("ModuleConfig; checking loop %s, module: %s, in: %s", + loop, mod, self.controller.get_spec(mod, 'module_runsIn')) + if loop in self.controller.get_spec(mod, 'module_runsIn'): + mlist.append(mod) + except InvalidModuleName: + logging.error("ModuleConfig; unkown module: %s, skipping", mod) + + logging.debug("ModuleConfig; mlist: %s", mlist) + return mlist diff --git a/repoman/pym/repoman/scanner.py b/repoman/pym/repoman/scanner.py index e13d4f68b..ffce701be 100644 --- a/repoman/pym/repoman/scanner.py +++ b/repoman/pym/repoman/scanner.py @@ -15,20 +15,10 @@ from repoman.modules.commit import repochecks from repoman.modules.commit import manifest f
[gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/, repoman/pym/repoman/modules/scan/keywords/
commit: 12fab561d3b63093805107cfcff4a425048db2aa Author: Alexis Ballier gentoo org> AuthorDate: Mon Jun 26 15:16:37 2017 + Commit: Brian Dolbec gentoo org> CommitDate: Tue Jun 27 21:29:30 2017 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=12fab561 repoman: Warn about dropped keywords only for latest in SLOT. Rationale: There is no point in rekeywording non-latest and nobody ever does that. Modified by: Brian Dolbec gentoo.org> , shorten commit message, add missed docstring. For example: $ epkginfo texlive-latex * dev-texlive/texlive-latex [gentoo] Maintainer: aballier gentoo.org (Alexis Ballier) Maintainer: tex gentoo.org (Gentoo TeX Project) Upstream:None specified Homepage:http://www.tug.org/texlive/ Location:/mnt/dev/gentoo-x86/dev-texlive/texlive-latex Keywords:2012:0: s390 sh sparc Keywords:2015:0: hppa ppc ppc64 Keywords:2016:0: alpha amd64 arm arm64 ia64 x86 Keywords:2017:0: ~alpha ~amd64 ~amd64-fbsd ~amd64-linux ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc-macos ~ppc64 ~s390 ~sh ~sparc ~sparc-solaris ~x64-macos ~x64-solaris ~x86 ~x86-fbsd ~x86-linux ~x86-macos ~x86-solaris Before: RepoMan scours the neighborhood... KEYWORDS.dropped 3 dev-texlive/texlive-latex/texlive-latex-2014.ebuild: ia64 sparc dev-texlive/texlive-latex/texlive-latex-2015.ebuild: ia64 sparc dev-texlive/texlive-latex/texlive-latex-2016.ebuild: sparc repo.eapi.deprecated 1 dev-texlive/texlive-latex/texlive-latex-2012.ebuild: 4 After: RepoMan scours the neighborhood... repo.eapi.deprecated 1 dev-texlive/texlive-latex/texlive-latex-2012.ebuild: 4 Or also: $ epkginfo ffmpeg * media-video/ffmpeg [gentoo] Maintainer: media-video gentoo.org Upstream:None specified Homepage:http://ffmpeg.org/ Location:/mnt/dev/gentoo-x86/media-video/ffmpeg Keywords:2.8.10:0/54.56.56: alpha amd64 arm hppa ia64 ppc ppc64 sparc x86 Keywords:2.8.11:0/54.56.56: ~alpha ~amd64 ~amd64-fbsd ~amd64-linux ~arm ~arm-linux ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-linux Keywords:3.2.4:0/55.57.57: alpha amd64 arm hppa ia64 ppc ppc64 x86 Keywords:3.2.5:0/55.57.57: Keywords:3.2.6:0/55.57.57: ~alpha ~ia64 Keywords:3.3.2:0/55.57.57: ~amd64 ~amd64-fbsd ~amd64-linux ~arm ~arm-linux ~arm64 ~hppa ~mips ~ppc ~ppc-macos ~ppc64 ~x64-macos ~x64-solaris ~x86 ~x86-fbsd ~x86-linux ~x86-macos ~x86-solaris Keywords::0/55.57.57: Before: RepoMan scours the neighborhood... KEYWORDS.dropped 4 media-video/ffmpeg/ffmpeg-3.2.4.ebuild: sparc media-video/ffmpeg/ffmpeg-3.2.5.ebuild: sparc media-video/ffmpeg/ffmpeg-3.2.6.ebuild: sparc media-video/ffmpeg/ffmpeg-3.3.2.ebuild: alpha ia64 sparc After: RepoMan scours the neighborhood... KEYWORDS.dropped 1 media-video/ffmpeg/ffmpeg-3.3.2.ebuild: alpha ia64 sparc X-Gentoo-Bug: 256189 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=256189 .../pym/repoman/modules/scan/keywords/keywords.py | 26 +- repoman/pym/repoman/scanner.py | 2 +- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/repoman/pym/repoman/modules/scan/keywords/keywords.py b/repoman/pym/repoman/modules/scan/keywords/keywords.py index 7cb2fe912..1e9623906 100644 --- a/repoman/pym/repoman/modules/scan/keywords/keywords.py +++ b/repoman/pym/repoman/modules/scan/keywords/keywords.py @@ -26,6 +26,7 @@ class KeywordChecks(ScanBase): def prepare(self, **kwargs): '''Prepare the checks for the next package.''' self.slot_keywords = {} + self.dropped_keywords = {} return False def check(self, **kwargs): @@ -57,6 +58,19 @@ class KeywordChecks(ScanBase): self.slot_keywords[pkg.slot].update(ebuild.archs) return False + def check_dropped_keywords(self, **kwargs): + '''Report on any dropped keywords for the latest ebuild in a slot + + @returns: boolean + ''' + for ebuild, arches in self.dropped_keywords.values(): + if arches: + self.qatracker.add_error( + "KEYWORDS.dropped", "%s: %s" % ( + ebuild, + " ".join(sorted(arches + return False + @staticmethod def _isKeywordStable(keyword): return not keyword.startswith("~") and not keyword.startswith("-") @@ -80,12 +94,9 @@ class KeywordChecks(ScanBase): if previous_keywords is None: self.slot_keywords[pkg.slot] = set() elif ebuild_archs and "*" not in ebuild_archs and not ebuild.live_ebuild: + self.slot_keywords[pkg.slot].update(ebuild_archs) d