[gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/
commit: fe0727bf0a5b4b0d27e06c2cb659c27edb259bd0 Author: Brian Dolbec gentoo org> AuthorDate: Sun Jan 3 23:23:52 2016 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Mar 12 17:57:37 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=fe0727bf repoman: Migrate code to a new MtimeChecks class in directories plugin pym/repoman/modules/scan/directories/__init__.py | 9 + pym/repoman/modules/scan/directories/mtime.py| 20 pym/repoman/scanner.py | 5 + 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/pym/repoman/modules/scan/directories/__init__.py b/pym/repoman/modules/scan/directories/__init__.py index bcc6eca..ec18d30 100644 --- a/pym/repoman/modules/scan/directories/__init__.py +++ b/pym/repoman/modules/scan/directories/__init__.py @@ -19,6 +19,15 @@ module_spec = { 'func_kwargs': { }, }, + 'mtime-module': { + 'name': "mtime", + 'sourcefile': "mtime", + 'class': "MtimeChecks", + 'description': doc, + 'functions': ['check'], + 'func_kwargs': { + }, + }, } } diff --git a/pym/repoman/modules/scan/directories/mtime.py b/pym/repoman/modules/scan/directories/mtime.py new file mode 100644 index 000..e25b553 --- /dev/null +++ b/pym/repoman/modules/scan/directories/mtime.py @@ -0,0 +1,20 @@ + + +class MtimeChecks(object): + + def __init__(self, **kwargs): + self.vcs_settings = kwargs.get('vcs_settings') + + def check(self, **kwargs): + ebuild = kwargs.get('ebuild') + changed = kwargs.get('changed') + pkg = kwargs.get('pkg') + if not self.vcs_settings.vcs_preserves_mtime: + if ebuild.ebuild_path not in changed.new_ebuilds and \ + ebuild.ebuild_path not in changed.ebuilds: + pkg.mtime = None + return {'continue': False} + + @property + def runInEbuilds(self): + return (True, [self.check]) diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py index c8fc245..359d9dd 100644 --- a/pym/repoman/scanner.py +++ b/pym/repoman/scanner.py @@ -294,6 +294,7 @@ class Scanner(object): ('arches', 'ArchChecks'), ('depend', 'DependChecks'), ('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'), ('license', 'LicenseChecks'), ('restrict', 'RestrictChecks'), + ('mtime', 'MtimeChecks'), ]: if mod[0]: mod_class = MODULE_CONTROLLER.get_class(mod[0]) @@ -322,10 +323,6 @@ class Scanner(object): continue # Syntax Checks - if not self.vcs_settings.vcs_preserves_mtime: - if dynamic_data['ebuild'].ebuild_path not in self.changed.new_ebuilds and \ - dynamic_data['ebuild'].ebuild_path not in self.changed.ebuilds: - dynamic_data['pkg'].mtime = None try: # All ebuilds should have utf_8 encoding. f = io.open(
[gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/
commit: 5136e5575803b3f2180b49a9f3dff1f51296d6b0 Author: Brian Dolbec gentoo org> AuthorDate: Sun Jan 3 23:23:52 2016 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Mar 10 23:47:35 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=5136e557 repoman: Migrate code to a new MtimeChecks class in directories plugin pym/repoman/modules/scan/directories/__init__.py | 9 + pym/repoman/modules/scan/directories/mtime.py| 20 pym/repoman/scanner.py | 5 + 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/pym/repoman/modules/scan/directories/__init__.py b/pym/repoman/modules/scan/directories/__init__.py index bcc6eca..ec18d30 100644 --- a/pym/repoman/modules/scan/directories/__init__.py +++ b/pym/repoman/modules/scan/directories/__init__.py @@ -19,6 +19,15 @@ module_spec = { 'func_kwargs': { }, }, + 'mtime-module': { + 'name': "mtime", + 'sourcefile': "mtime", + 'class': "MtimeChecks", + 'description': doc, + 'functions': ['check'], + 'func_kwargs': { + }, + }, } } diff --git a/pym/repoman/modules/scan/directories/mtime.py b/pym/repoman/modules/scan/directories/mtime.py new file mode 100644 index 000..e25b553 --- /dev/null +++ b/pym/repoman/modules/scan/directories/mtime.py @@ -0,0 +1,20 @@ + + +class MtimeChecks(object): + + def __init__(self, **kwargs): + self.vcs_settings = kwargs.get('vcs_settings') + + def check(self, **kwargs): + ebuild = kwargs.get('ebuild') + changed = kwargs.get('changed') + pkg = kwargs.get('pkg') + if not self.vcs_settings.vcs_preserves_mtime: + if ebuild.ebuild_path not in changed.new_ebuilds and \ + ebuild.ebuild_path not in changed.ebuilds: + pkg.mtime = None + return {'continue': False} + + @property + def runInEbuilds(self): + return (True, [self.check]) diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py index c8fc245..359d9dd 100644 --- a/pym/repoman/scanner.py +++ b/pym/repoman/scanner.py @@ -294,6 +294,7 @@ class Scanner(object): ('arches', 'ArchChecks'), ('depend', 'DependChecks'), ('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'), ('license', 'LicenseChecks'), ('restrict', 'RestrictChecks'), + ('mtime', 'MtimeChecks'), ]: if mod[0]: mod_class = MODULE_CONTROLLER.get_class(mod[0]) @@ -322,10 +323,6 @@ class Scanner(object): continue # Syntax Checks - if not self.vcs_settings.vcs_preserves_mtime: - if dynamic_data['ebuild'].ebuild_path not in self.changed.new_ebuilds and \ - dynamic_data['ebuild'].ebuild_path not in self.changed.ebuilds: - dynamic_data['pkg'].mtime = None try: # All ebuilds should have utf_8 encoding. f = io.open(
[gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/
commit: c5bd7eacdac16ea2e4b56933f7c85334d51070d6 Author: Brian Dolbec gentoo org> AuthorDate: Sun Jan 3 23:23:52 2016 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Jan 30 20:25:23 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=c5bd7eac repoman: Migrate code to a new MtimeChecks class in directories plugin pym/repoman/modules/scan/directories/__init__.py | 9 + pym/repoman/modules/scan/directories/mtime.py| 24 pym/repoman/scanner.py | 5 + 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/pym/repoman/modules/scan/directories/__init__.py b/pym/repoman/modules/scan/directories/__init__.py index bcc6eca..ec18d30 100644 --- a/pym/repoman/modules/scan/directories/__init__.py +++ b/pym/repoman/modules/scan/directories/__init__.py @@ -19,6 +19,15 @@ module_spec = { 'func_kwargs': { }, }, + 'mtime-module': { + 'name': "mtime", + 'sourcefile': "mtime", + 'class': "MtimeChecks", + 'description': doc, + 'functions': ['check'], + 'func_kwargs': { + }, + }, } } diff --git a/pym/repoman/modules/scan/directories/mtime.py b/pym/repoman/modules/scan/directories/mtime.py new file mode 100644 index 000..e113cdd --- /dev/null +++ b/pym/repoman/modules/scan/directories/mtime.py @@ -0,0 +1,24 @@ + + +class MtimeChecks(object): + + def __init__(self, **kwargs): + self.vcs_settings = kwargs.get('vcs_settings') + + def check(self, **kwargs): + ebuild = kwargs.get('ebuild') + changed = kwargs.get('changed') + pkg = kwargs.get('pkg') + if not self.vcs_settings.vcs_preserves_mtime: + if ebuild.ebuild_path not in changed.new_ebuilds and \ + ebuild.ebuild_path not in changed.ebuilds: + pkg.mtime = None + 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 92e2abd..308b440 100644 --- a/pym/repoman/scanner.py +++ b/pym/repoman/scanner.py @@ -294,6 +294,7 @@ class Scanner(object): ('arches', 'ArchChecks'), ('depend', 'DependChecks'), ('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'), ('license', 'LicenseChecks'), ('restrict', 'RestrictChecks'), + ('mtime', 'MtimeChecks'), ]: if mod[0]: mod_class = MODULE_CONTROLLER.get_class(mod[0]) @@ -322,10 +323,6 @@ class Scanner(object): continue # Syntax Checks - if not self.vcs_settings.vcs_preserves_mtime: - if dynamic_data['ebuild'].ebuild_path not in self.changed.new_ebuilds and \ - dynamic_data['ebuild'].ebuild_path not in self.changed.ebuilds: - dynamic_data['pkg'].mtime = None try: # All ebuilds should have utf_8 encoding. f = io.open(
[gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/
commit: a780c83a7085b3472bd2be0b7f5dbeb17c48ada7 Author: Brian Dolbec gentoo org> AuthorDate: Sun Jan 3 23:23:52 2016 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Jan 30 07:50:19 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=a780c83a repoman: Migrate code to a new MtimeChecks class in directories plugin pym/repoman/modules/scan/directories/__init__.py | 9 + pym/repoman/modules/scan/directories/mtime.py| 24 pym/repoman/scanner.py | 5 + 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/pym/repoman/modules/scan/directories/__init__.py b/pym/repoman/modules/scan/directories/__init__.py index bcc6eca..ec18d30 100644 --- a/pym/repoman/modules/scan/directories/__init__.py +++ b/pym/repoman/modules/scan/directories/__init__.py @@ -19,6 +19,15 @@ module_spec = { 'func_kwargs': { }, }, + 'mtime-module': { + 'name': "mtime", + 'sourcefile': "mtime", + 'class': "MtimeChecks", + 'description': doc, + 'functions': ['check'], + 'func_kwargs': { + }, + }, } } diff --git a/pym/repoman/modules/scan/directories/mtime.py b/pym/repoman/modules/scan/directories/mtime.py new file mode 100644 index 000..e113cdd --- /dev/null +++ b/pym/repoman/modules/scan/directories/mtime.py @@ -0,0 +1,24 @@ + + +class MtimeChecks(object): + + def __init__(self, **kwargs): + self.vcs_settings = kwargs.get('vcs_settings') + + def check(self, **kwargs): + ebuild = kwargs.get('ebuild') + changed = kwargs.get('changed') + pkg = kwargs.get('pkg') + if not self.vcs_settings.vcs_preserves_mtime: + if ebuild.ebuild_path not in changed.new_ebuilds and \ + ebuild.ebuild_path not in changed.ebuilds: + pkg.mtime = None + 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 dcb955c..d15 100644 --- a/pym/repoman/scanner.py +++ b/pym/repoman/scanner.py @@ -294,6 +294,7 @@ class Scanner(object): ('arches', 'ArchChecks'), ('depend', 'DependChecks'), ('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'), ('license', 'LicenseChecks'), ('restrict', 'RestrictChecks'), + ('mtime', 'MtimeChecks'), ]: if mod[0]: mod_class = MODULE_CONTROLLER.get_class(mod[0]) @@ -322,10 +323,6 @@ class Scanner(object): continue # Syntax Checks - if not self.vcs_settings.vcs_preserves_mtime: - if dynamic_data['ebuild'].ebuild_path not in self.changed.new_ebuilds and \ - dynamic_data['ebuild'].ebuild_path not in self.changed.ebuilds: - dynamic_data['pkg'].mtime = None try: # All ebuilds should have utf_8 encoding. f = io.open(
[gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/
commit: 196ac80c1b39d6f5b795b7cbd56c735eeac6414c Author: Brian Dolbec gentoo org> AuthorDate: Sun Jan 3 23:23:52 2016 + Commit: Brian Dolbec gentoo org> CommitDate: Sat Jan 30 06:51:57 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=196ac80c repoman: Migrate code to a new MtimeChecks class in directories plugin pym/repoman/modules/scan/directories/__init__.py | 9 + pym/repoman/modules/scan/directories/mtime.py| 24 pym/repoman/scanner.py | 5 + 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/pym/repoman/modules/scan/directories/__init__.py b/pym/repoman/modules/scan/directories/__init__.py index bcc6eca..ec18d30 100644 --- a/pym/repoman/modules/scan/directories/__init__.py +++ b/pym/repoman/modules/scan/directories/__init__.py @@ -19,6 +19,15 @@ module_spec = { 'func_kwargs': { }, }, + 'mtime-module': { + 'name': "mtime", + 'sourcefile': "mtime", + 'class': "MtimeChecks", + 'description': doc, + 'functions': ['check'], + 'func_kwargs': { + }, + }, } } diff --git a/pym/repoman/modules/scan/directories/mtime.py b/pym/repoman/modules/scan/directories/mtime.py new file mode 100644 index 000..e113cdd --- /dev/null +++ b/pym/repoman/modules/scan/directories/mtime.py @@ -0,0 +1,24 @@ + + +class MtimeChecks(object): + + def __init__(self, **kwargs): + self.vcs_settings = kwargs.get('vcs_settings') + + def check(self, **kwargs): + ebuild = kwargs.get('ebuild') + changed = kwargs.get('changed') + pkg = kwargs.get('pkg') + if not self.vcs_settings.vcs_preserves_mtime: + if ebuild.ebuild_path not in changed.new_ebuilds and \ + ebuild.ebuild_path not in changed.ebuilds: + pkg.mtime = None + 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 dcb955c..d15 100644 --- a/pym/repoman/scanner.py +++ b/pym/repoman/scanner.py @@ -294,6 +294,7 @@ class Scanner(object): ('arches', 'ArchChecks'), ('depend', 'DependChecks'), ('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'), ('license', 'LicenseChecks'), ('restrict', 'RestrictChecks'), + ('mtime', 'MtimeChecks'), ]: if mod[0]: mod_class = MODULE_CONTROLLER.get_class(mod[0]) @@ -322,10 +323,6 @@ class Scanner(object): continue # Syntax Checks - if not self.vcs_settings.vcs_preserves_mtime: - if dynamic_data['ebuild'].ebuild_path not in self.changed.new_ebuilds and \ - dynamic_data['ebuild'].ebuild_path not in self.changed.ebuilds: - dynamic_data['pkg'].mtime = None try: # All ebuilds should have utf_8 encoding. f = io.open(
[gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/
commit: 7d4a692d86493c774398d9a751855fdc4c10d00c Author: Brian Dolbec gentoo org> AuthorDate: Sun Jan 3 23:23:52 2016 + Commit: Brian Dolbec gentoo org> CommitDate: Fri Jan 29 04:52:59 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=7d4a692d repoman: Migrate code to a new MtimeChecks class in directories plugin pym/repoman/modules/scan/directories/__init__.py | 9 + pym/repoman/modules/scan/directories/mtime.py| 24 pym/repoman/scanner.py | 5 + 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/pym/repoman/modules/scan/directories/__init__.py b/pym/repoman/modules/scan/directories/__init__.py index bcc6eca..ec18d30 100644 --- a/pym/repoman/modules/scan/directories/__init__.py +++ b/pym/repoman/modules/scan/directories/__init__.py @@ -19,6 +19,15 @@ module_spec = { 'func_kwargs': { }, }, + 'mtime-module': { + 'name': "mtime", + 'sourcefile': "mtime", + 'class': "MtimeChecks", + 'description': doc, + 'functions': ['check'], + 'func_kwargs': { + }, + }, } } diff --git a/pym/repoman/modules/scan/directories/mtime.py b/pym/repoman/modules/scan/directories/mtime.py new file mode 100644 index 000..e113cdd --- /dev/null +++ b/pym/repoman/modules/scan/directories/mtime.py @@ -0,0 +1,24 @@ + + +class MtimeChecks(object): + + def __init__(self, **kwargs): + self.vcs_settings = kwargs.get('vcs_settings') + + def check(self, **kwargs): + ebuild = kwargs.get('ebuild') + changed = kwargs.get('changed') + pkg = kwargs.get('pkg') + if not self.vcs_settings.vcs_preserves_mtime: + if ebuild.ebuild_path not in changed.new_ebuilds and \ + ebuild.ebuild_path not in changed.ebuilds: + pkg.mtime = None + 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 1b6bbb4..683d791 100644 --- a/pym/repoman/scanner.py +++ b/pym/repoman/scanner.py @@ -296,6 +296,7 @@ class Scanner(object): ('arches', 'ArchChecks'), ('depend', 'DependChecks'), ('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'), ('license', 'LicenseChecks'), ('restrict', 'RestrictChecks'), + ('mtime', 'MtimeChecks'), ]: if mod[0]: mod_class = MODULE_CONTROLLER.get_class(mod[0]) @@ -324,10 +325,6 @@ class Scanner(object): continue # Syntax Checks - if not self.vcs_settings.vcs_preserves_mtime: - if dynamic_data['ebuild'].ebuild_path not in self.changed.new_ebuilds and \ - dynamic_data['ebuild'].ebuild_path not in self.changed.ebuilds: - dynamic_data['pkg'].mtime = None try: # All ebuilds should have utf_8 encoding. f = io.open(
[gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/
commit: 8a0ca4414e34006590b51272df10f0febf6e9abb Author: Brian Dolbec gentoo org> AuthorDate: Sun Jan 3 23:23:52 2016 + Commit: Brian Dolbec gentoo org> CommitDate: Wed Jan 27 22:44:24 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=8a0ca441 repoman: Migrate code to a new MtimeChecks class in directories plugin pym/repoman/modules/scan/directories/__init__.py | 9 + pym/repoman/modules/scan/directories/mtime.py| 24 pym/repoman/scanner.py | 5 + 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/pym/repoman/modules/scan/directories/__init__.py b/pym/repoman/modules/scan/directories/__init__.py index bcc6eca..ec18d30 100644 --- a/pym/repoman/modules/scan/directories/__init__.py +++ b/pym/repoman/modules/scan/directories/__init__.py @@ -19,6 +19,15 @@ module_spec = { 'func_kwargs': { }, }, + 'mtime-module': { + 'name': "mtime", + 'sourcefile': "mtime", + 'class': "MtimeChecks", + 'description': doc, + 'functions': ['check'], + 'func_kwargs': { + }, + }, } } diff --git a/pym/repoman/modules/scan/directories/mtime.py b/pym/repoman/modules/scan/directories/mtime.py new file mode 100644 index 000..e113cdd --- /dev/null +++ b/pym/repoman/modules/scan/directories/mtime.py @@ -0,0 +1,24 @@ + + +class MtimeChecks(object): + + def __init__(self, **kwargs): + self.vcs_settings = kwargs.get('vcs_settings') + + def check(self, **kwargs): + ebuild = kwargs.get('ebuild') + changed = kwargs.get('changed') + pkg = kwargs.get('pkg') + if not self.vcs_settings.vcs_preserves_mtime: + if ebuild.ebuild_path not in changed.new_ebuilds and \ + ebuild.ebuild_path not in changed.ebuilds: + pkg.mtime = None + 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 1b6bbb4..683d791 100644 --- a/pym/repoman/scanner.py +++ b/pym/repoman/scanner.py @@ -296,6 +296,7 @@ class Scanner(object): ('arches', 'ArchChecks'), ('depend', 'DependChecks'), ('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'), ('license', 'LicenseChecks'), ('restrict', 'RestrictChecks'), + ('mtime', 'MtimeChecks'), ]: if mod[0]: mod_class = MODULE_CONTROLLER.get_class(mod[0]) @@ -324,10 +325,6 @@ class Scanner(object): continue # Syntax Checks - if not self.vcs_settings.vcs_preserves_mtime: - if dynamic_data['ebuild'].ebuild_path not in self.changed.new_ebuilds and \ - dynamic_data['ebuild'].ebuild_path not in self.changed.ebuilds: - dynamic_data['pkg'].mtime = None try: # All ebuilds should have utf_8 encoding. f = io.open(
[gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/
commit: 53c62710cc5c5fa7c2a11a01a825edaee454c073 Author: Brian Dolbec gentoo org> AuthorDate: Sun Jan 3 23:23:52 2016 + Commit: Brian Dolbec gentoo org> CommitDate: Fri Jan 22 18:44:13 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=53c62710 repoman: Migrate code to a new MtimeChecks class in directories plugin pym/repoman/modules/scan/directories/__init__.py | 8 pym/repoman/modules/scan/directories/mtime.py| 24 pym/repoman/scanner.py | 5 + 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/pym/repoman/modules/scan/directories/__init__.py b/pym/repoman/modules/scan/directories/__init__.py index 7fe9f0e..b9daef0 100644 --- a/pym/repoman/modules/scan/directories/__init__.py +++ b/pym/repoman/modules/scan/directories/__init__.py @@ -18,6 +18,14 @@ module_spec = { 'func_kwargs': { }, }, + 'mtime-module': { + 'name': "mtime", + 'class': "MtimeChecks", + 'description': doc, + 'functions': ['check'], + 'func_kwargs': { + }, + }, } } diff --git a/pym/repoman/modules/scan/directories/mtime.py b/pym/repoman/modules/scan/directories/mtime.py new file mode 100644 index 000..e113cdd --- /dev/null +++ b/pym/repoman/modules/scan/directories/mtime.py @@ -0,0 +1,24 @@ + + +class MtimeChecks(object): + + def __init__(self, **kwargs): + self.vcs_settings = kwargs.get('vcs_settings') + + def check(self, **kwargs): + ebuild = kwargs.get('ebuild') + changed = kwargs.get('changed') + pkg = kwargs.get('pkg') + if not self.vcs_settings.vcs_preserves_mtime: + if ebuild.ebuild_path not in changed.new_ebuilds and \ + ebuild.ebuild_path not in changed.ebuilds: + pkg.mtime = None + 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 8657c73..b00dbd9 100644 --- a/pym/repoman/scanner.py +++ b/pym/repoman/scanner.py @@ -293,6 +293,7 @@ class Scanner(object): ('arches', 'ArchChecks'), ('depend', 'DependChecks'), ('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'), ('license', 'LicenseChecks'), ('restrict', 'RestrictChecks'), + ('mtime', 'MtimeChecks'), ]: if mod[0]: mod_class = MODULE_CONTROLLER.get_class(mod[0]) @@ -321,10 +322,6 @@ class Scanner(object): continue # Syntax Checks - if not self.vcs_settings.vcs_preserves_mtime: - if dynamic_data['ebuild'].ebuild_path not in self.changed.new_ebuilds and \ - dynamic_data['ebuild'].ebuild_path not in self.changed.ebuilds: - dynamic_data['pkg'].mtime = None try: # All ebuilds should have utf_8 encoding. f = io.open(
[gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/
commit: 71d070cccf6b34fa39bf2549029dc1253e14c736 Author: Brian Dolbec gentoo org> AuthorDate: Sun Jan 3 23:23:52 2016 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Jan 21 00:35:22 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=71d070cc repoman: Migrate code to a new MtimeChecks class in directories plugin pym/repoman/modules/scan/directories/__init__.py | 8 pym/repoman/modules/scan/directories/mtime.py| 24 pym/repoman/scanner.py | 5 + 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/pym/repoman/modules/scan/directories/__init__.py b/pym/repoman/modules/scan/directories/__init__.py index 7fe9f0e..b9daef0 100644 --- a/pym/repoman/modules/scan/directories/__init__.py +++ b/pym/repoman/modules/scan/directories/__init__.py @@ -18,6 +18,14 @@ module_spec = { 'func_kwargs': { }, }, + 'mtime-module': { + 'name': "mtime", + 'class': "MtimeChecks", + 'description': doc, + 'functions': ['check'], + 'func_kwargs': { + }, + }, } } diff --git a/pym/repoman/modules/scan/directories/mtime.py b/pym/repoman/modules/scan/directories/mtime.py new file mode 100644 index 000..e113cdd --- /dev/null +++ b/pym/repoman/modules/scan/directories/mtime.py @@ -0,0 +1,24 @@ + + +class MtimeChecks(object): + + def __init__(self, **kwargs): + self.vcs_settings = kwargs.get('vcs_settings') + + def check(self, **kwargs): + ebuild = kwargs.get('ebuild') + changed = kwargs.get('changed') + pkg = kwargs.get('pkg') + if not self.vcs_settings.vcs_preserves_mtime: + if ebuild.ebuild_path not in changed.new_ebuilds and \ + ebuild.ebuild_path not in changed.ebuilds: + pkg.mtime = None + 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 8657c73..b00dbd9 100644 --- a/pym/repoman/scanner.py +++ b/pym/repoman/scanner.py @@ -293,6 +293,7 @@ class Scanner(object): ('arches', 'ArchChecks'), ('depend', 'DependChecks'), ('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'), ('license', 'LicenseChecks'), ('restrict', 'RestrictChecks'), + ('mtime', 'MtimeChecks'), ]: if mod[0]: mod_class = MODULE_CONTROLLER.get_class(mod[0]) @@ -321,10 +322,6 @@ class Scanner(object): continue # Syntax Checks - if not self.vcs_settings.vcs_preserves_mtime: - if dynamic_data['ebuild'].ebuild_path not in self.changed.new_ebuilds and \ - dynamic_data['ebuild'].ebuild_path not in self.changed.ebuilds: - dynamic_data['pkg'].mtime = None try: # All ebuilds should have utf_8 encoding. f = io.open(
[gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/modules/scan/ebuild/, ...
commit: 97da70354a787041d4edb038d203b0f87893f893 Author: Brian Dolbec gentoo org> AuthorDate: Mon Jan 4 04:44:05 2016 + Commit: Brian Dolbec gentoo org> CommitDate: Thu Jan 21 02:51:22 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=97da7035 repoman: Create new MultiCheck class plugin Move ebuilds/ checks.py and errors.py to the scan/ebuild plugin Remove the checks_init from main(), initialize it in the MultiCheck class where it is needed. pym/repoman/checks/ebuilds/__init__.py | 0 pym/repoman/main.py| 2 - pym/repoman/modules/scan/directories/encoding.py | 43 ++ pym/repoman/modules/scan/ebuild/__init__.py| 8 .../ebuilds => modules/scan/ebuild}/checks.py | 2 +- .../ebuilds => modules/scan/ebuild}/errors.py | 0 pym/repoman/modules/scan/ebuild/multicheck.py | 43 ++ pym/repoman/scanner.py | 21 +-- 8 files changed, 96 insertions(+), 23 deletions(-) diff --git a/pym/repoman/checks/ebuilds/__init__.py b/pym/repoman/checks/ebuilds/__init__.py deleted file mode 100644 index e69de29..000 diff --git a/pym/repoman/main.py b/pym/repoman/main.py index 8784685..890e034 100755 --- a/pym/repoman/main.py +++ b/pym/repoman/main.py @@ -26,7 +26,6 @@ from portage.util import formatter from repoman.actions import Actions from repoman.argparser import parse_args -from repoman.checks.ebuilds.checks import checks_init from repoman.qa_data import ( format_qa_output, format_qa_output_column, qahelp, qawarnings, qacats) @@ -65,7 +64,6 @@ def repoman_main(argv): if options.experimental_inherit == 'y': # This is experimental, so it's non-fatal. qawarnings.add("inherit.missing") - checks_init(experimental_inherit=True) # Set this to False when an extraordinary issue (generally # something other than a QA issue) makes it impossible to diff --git a/pym/repoman/modules/scan/directories/encoding.py b/pym/repoman/modules/scan/directories/encoding.py new file mode 100644 index 000..82a9a38 --- /dev/null +++ b/pym/repoman/modules/scan/directories/encoding.py @@ -0,0 +1,43 @@ + +import io + +from portage import _encodings +from portage import _unicode_encode + +from .checks import run_checks, checks_init + + +class EncodingCheck(object): + + def __init__(self, **kwargs): + self.qatracker = kwargs.get('qatracker') + self.options = kwargs.get('options') + checks_init(self.options.experimental_inherit == 'y') + + def check(self, **kwargs): + ebuild = kwargs.get('ebuild') + pkg = kwargs.get('pkg') + try: + # All ebuilds should have utf_8 encoding. + f = io.open( + _unicode_encode(ebuild.full_path, encoding=_encodings['fs'], + errors='strict'), + mode='r', encoding=_encodings['repo.content']) + try: + for check_name, e in run_checks(f, pkg): + self.qatracker.add_error( + check_name, ebuild.relative_path + ': %s' % e) + finally: + f.close() + except UnicodeDecodeError: + # A file.UTF8 failure will have already been recorded. + pass + return {'continue': False} + + @property + def runInPkgs(self): + return (False, []) + + @property + def runInEbuilds(self): + return (True, [self.check]) diff --git a/pym/repoman/modules/scan/ebuild/__init__.py b/pym/repoman/modules/scan/ebuild/__init__.py index 9747bf0..038cef3 100644 --- a/pym/repoman/modules/scan/ebuild/__init__.py +++ b/pym/repoman/modules/scan/ebuild/__init__.py @@ -26,6 +26,14 @@ module_spec = { 'func_desc': { }, }, + 'multicheck-module': { + 'name': "multicheck", + 'class': "MultiCheck", + 'description': doc, + 'functions': ['check'], + 'func_kwargs': { + }, + }, } } diff --git a/pym/repoman/checks/ebuilds/checks.py b/pym/repoman/modules/scan/ebuild/checks.py similarity index 99% rename from pym/repoman/checks/ebuilds/checks.py rename to pym/repoman/modules/scan/ebuild/checks.py index 5420e51..be59b05 100644 --- a/pym/repoman/checks/ebuilds/checks.py +++ b/pym/repoman/modules/scan/ebuild/checks.py @@ -21,7 +21,7 @@ from portage.eapi import ( eapi_has_src_prepare_and_src_configure,
[gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/
commit: 451fb7d79279e9a7339e84b802cf15443466f370 Author: Brian Dolbec gentoo org> AuthorDate: Sun Jan 3 23:23:52 2016 + Commit: Brian Dolbec gentoo org> CommitDate: Mon Jan 18 19:20:03 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=451fb7d7 repoman: Migrate code to a new MtimeChecks class in directories plugin pym/repoman/modules/scan/directories/__init__.py | 8 pym/repoman/modules/scan/directories/mtime.py| 24 pym/repoman/scanner.py | 5 + 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/pym/repoman/modules/scan/directories/__init__.py b/pym/repoman/modules/scan/directories/__init__.py index 7fe9f0e..b9daef0 100644 --- a/pym/repoman/modules/scan/directories/__init__.py +++ b/pym/repoman/modules/scan/directories/__init__.py @@ -18,6 +18,14 @@ module_spec = { 'func_kwargs': { }, }, + 'mtime-module': { + 'name': "mtime", + 'class': "MtimeChecks", + 'description': doc, + 'functions': ['check'], + 'func_kwargs': { + }, + }, } } diff --git a/pym/repoman/modules/scan/directories/mtime.py b/pym/repoman/modules/scan/directories/mtime.py new file mode 100644 index 000..e113cdd --- /dev/null +++ b/pym/repoman/modules/scan/directories/mtime.py @@ -0,0 +1,24 @@ + + +class MtimeChecks(object): + + def __init__(self, **kwargs): + self.vcs_settings = kwargs.get('vcs_settings') + + def check(self, **kwargs): + ebuild = kwargs.get('ebuild') + changed = kwargs.get('changed') + pkg = kwargs.get('pkg') + if not self.vcs_settings.vcs_preserves_mtime: + if ebuild.ebuild_path not in changed.new_ebuilds and \ + ebuild.ebuild_path not in changed.ebuilds: + pkg.mtime = None + 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 8657c73..b00dbd9 100644 --- a/pym/repoman/scanner.py +++ b/pym/repoman/scanner.py @@ -293,6 +293,7 @@ class Scanner(object): ('arches', 'ArchChecks'), ('depend', 'DependChecks'), ('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'), ('license', 'LicenseChecks'), ('restrict', 'RestrictChecks'), + ('mtime', 'MtimeChecks'), ]: if mod[0]: mod_class = MODULE_CONTROLLER.get_class(mod[0]) @@ -321,10 +322,6 @@ class Scanner(object): continue # Syntax Checks - if not self.vcs_settings.vcs_preserves_mtime: - if dynamic_data['ebuild'].ebuild_path not in self.changed.new_ebuilds and \ - dynamic_data['ebuild'].ebuild_path not in self.changed.ebuilds: - dynamic_data['pkg'].mtime = None try: # All ebuilds should have utf_8 encoding. f = io.open(
[gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/
commit: 7609a1b012c9b91b01164dad8e4bc16cf0c3871e Author: Brian Dolbec gentoo org> AuthorDate: Mon Jan 4 04:44:05 2016 + Commit: Brian Dolbec gentoo org> CommitDate: Mon Jan 18 19:20:03 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=7609a1b0 repoman: Create new EncodingCheck class plugin pym/repoman/modules/scan/directories/__init__.py | 8 + pym/repoman/modules/scan/directories/encoding.py | 41 pym/repoman/scanner.py | 21 +--- 3 files changed, 50 insertions(+), 20 deletions(-) diff --git a/pym/repoman/modules/scan/directories/__init__.py b/pym/repoman/modules/scan/directories/__init__.py index b9daef0..548d393 100644 --- a/pym/repoman/modules/scan/directories/__init__.py +++ b/pym/repoman/modules/scan/directories/__init__.py @@ -26,6 +26,14 @@ module_spec = { 'func_kwargs': { }, }, + 'encoding-module': { + 'name': "encoding", + 'class': "EncodingCheck", + 'description': doc, + 'functions': ['check'], + 'func_kwargs': { + }, + }, } } diff --git a/pym/repoman/modules/scan/directories/encoding.py b/pym/repoman/modules/scan/directories/encoding.py new file mode 100644 index 000..0985e16 --- /dev/null +++ b/pym/repoman/modules/scan/directories/encoding.py @@ -0,0 +1,41 @@ + +import io + +from portage import _encodings +from portage import _unicode_encode + +from repoman.checks.ebuilds.checks import run_checks + + +class EncodingCheck(object): + + def __init__(self, **kwargs): + self.qatracker = kwargs.get('qatracker') + + def check(self, **kwargs): + ebuild = kwargs.get('ebuild') + pkg = kwargs.get('pkg') + try: + # All ebuilds should have utf_8 encoding. + f = io.open( + _unicode_encode(ebuild.full_path, encoding=_encodings['fs'], + errors='strict'), + mode='r', encoding=_encodings['repo.content']) + try: + for check_name, e in run_checks(f, pkg): + self.qatracker.add_error( + check_name, ebuild.relative_path + ': %s' % e) + finally: + f.close() + except UnicodeDecodeError: + # A file.UTF8 failure will have already been recorded. + pass + 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 b00dbd9..ac77d1f 100644 --- a/pym/repoman/scanner.py +++ b/pym/repoman/scanner.py @@ -3,7 +3,6 @@ from __future__ import print_function, unicode_literals import copy -import io import logging from itertools import chain from pprint import pformat @@ -13,11 +12,8 @@ from _emerge.Package import Package import portage from portage import normalize_path from portage import os -from portage import _encodings -from portage import _unicode_encode from portage.dep import Atom from portage.output import green -from repoman.checks.ebuilds.checks import run_checks from repoman.modules.commit import repochecks from repoman.profile import check_profiles, dev_profile_keywords, setup_profile from repoman.repos import repo_metadata @@ -293,7 +289,7 @@ class Scanner(object): ('arches', 'ArchChecks'), ('depend', 'DependChecks'), ('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'), ('license', 'LicenseChecks'), ('restrict', 'RestrictChecks'), - ('mtime', 'MtimeChecks'), + ('mtime', 'MtimeChecks'), ('encoding', 'EncodingCheck'), ]: if mod[0]: mod_class = MODULE_CONTROLLER.get_class(mod[0]) @@ -322,21 +318,6 @@ class Scanner(object): continue # Syntax Checks - try: - # All ebuilds should have utf_8 encoding. - f = io.open( - _unicode_encode( - dynamic_data['ebuild'].full_path, encoding=_encodings['fs'], errors='strict'), - mode='r',
[gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/
commit: a7abf497b92fcd20b122473a71e8ce69a5995029 Author: Brian Dolbec gentoo org> AuthorDate: Sun Jan 3 23:23:52 2016 + Commit: Brian Dolbec gentoo org> CommitDate: Mon Jan 11 08:00:18 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=a7abf497 repoman: Migrate code to a new MtimeChecks class in directories plugin pym/repoman/modules/scan/directories/__init__.py | 8 pym/repoman/modules/scan/directories/mtime.py| 24 pym/repoman/scanner.py | 5 + 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/pym/repoman/modules/scan/directories/__init__.py b/pym/repoman/modules/scan/directories/__init__.py index 7fe9f0e..b9daef0 100644 --- a/pym/repoman/modules/scan/directories/__init__.py +++ b/pym/repoman/modules/scan/directories/__init__.py @@ -18,6 +18,14 @@ module_spec = { 'func_kwargs': { }, }, + 'mtime-module': { + 'name': "mtime", + 'class': "MtimeChecks", + 'description': doc, + 'functions': ['check'], + 'func_kwargs': { + }, + }, } } diff --git a/pym/repoman/modules/scan/directories/mtime.py b/pym/repoman/modules/scan/directories/mtime.py new file mode 100644 index 000..e113cdd --- /dev/null +++ b/pym/repoman/modules/scan/directories/mtime.py @@ -0,0 +1,24 @@ + + +class MtimeChecks(object): + + def __init__(self, **kwargs): + self.vcs_settings = kwargs.get('vcs_settings') + + def check(self, **kwargs): + ebuild = kwargs.get('ebuild') + changed = kwargs.get('changed') + pkg = kwargs.get('pkg') + if not self.vcs_settings.vcs_preserves_mtime: + if ebuild.ebuild_path not in changed.new_ebuilds and \ + ebuild.ebuild_path not in changed.ebuilds: + pkg.mtime = None + 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 8657c73..b00dbd9 100644 --- a/pym/repoman/scanner.py +++ b/pym/repoman/scanner.py @@ -293,6 +293,7 @@ class Scanner(object): ('arches', 'ArchChecks'), ('depend', 'DependChecks'), ('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'), ('license', 'LicenseChecks'), ('restrict', 'RestrictChecks'), + ('mtime', 'MtimeChecks'), ]: if mod[0]: mod_class = MODULE_CONTROLLER.get_class(mod[0]) @@ -321,10 +322,6 @@ class Scanner(object): continue # Syntax Checks - if not self.vcs_settings.vcs_preserves_mtime: - if dynamic_data['ebuild'].ebuild_path not in self.changed.new_ebuilds and \ - dynamic_data['ebuild'].ebuild_path not in self.changed.ebuilds: - dynamic_data['pkg'].mtime = None try: # All ebuilds should have utf_8 encoding. f = io.open(
[gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/
commit: 35b9fb610626831c008cffbfb5c403c1243b6175 Author: Brian Dolbec gentoo org> AuthorDate: Sun Jan 3 23:23:52 2016 + Commit: Brian Dolbec gentoo org> CommitDate: Sun Jan 10 22:59:37 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=35b9fb61 repoman: Migrate code to a new MtimeChecks class in directories plugin pym/repoman/modules/scan/directories/__init__.py | 8 pym/repoman/modules/scan/directories/mtime.py| 24 pym/repoman/scanner.py | 5 + 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/pym/repoman/modules/scan/directories/__init__.py b/pym/repoman/modules/scan/directories/__init__.py index 7fe9f0e..b9daef0 100644 --- a/pym/repoman/modules/scan/directories/__init__.py +++ b/pym/repoman/modules/scan/directories/__init__.py @@ -18,6 +18,14 @@ module_spec = { 'func_kwargs': { }, }, + 'mtime-module': { + 'name': "mtime", + 'class': "MtimeChecks", + 'description': doc, + 'functions': ['check'], + 'func_kwargs': { + }, + }, } } diff --git a/pym/repoman/modules/scan/directories/mtime.py b/pym/repoman/modules/scan/directories/mtime.py new file mode 100644 index 000..e113cdd --- /dev/null +++ b/pym/repoman/modules/scan/directories/mtime.py @@ -0,0 +1,24 @@ + + +class MtimeChecks(object): + + def __init__(self, **kwargs): + self.vcs_settings = kwargs.get('vcs_settings') + + def check(self, **kwargs): + ebuild = kwargs.get('ebuild') + changed = kwargs.get('changed') + pkg = kwargs.get('pkg') + if not self.vcs_settings.vcs_preserves_mtime: + if ebuild.ebuild_path not in changed.new_ebuilds and \ + ebuild.ebuild_path not in changed.ebuilds: + pkg.mtime = None + 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 8657c73..b00dbd9 100644 --- a/pym/repoman/scanner.py +++ b/pym/repoman/scanner.py @@ -293,6 +293,7 @@ class Scanner(object): ('arches', 'ArchChecks'), ('depend', 'DependChecks'), ('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'), ('license', 'LicenseChecks'), ('restrict', 'RestrictChecks'), + ('mtime', 'MtimeChecks'), ]: if mod[0]: mod_class = MODULE_CONTROLLER.get_class(mod[0]) @@ -321,10 +322,6 @@ class Scanner(object): continue # Syntax Checks - if not self.vcs_settings.vcs_preserves_mtime: - if dynamic_data['ebuild'].ebuild_path not in self.changed.new_ebuilds and \ - dynamic_data['ebuild'].ebuild_path not in self.changed.ebuilds: - dynamic_data['pkg'].mtime = None try: # All ebuilds should have utf_8 encoding. f = io.open(
[gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/
commit: 9413c11a3d156addb642b0758ecd4535e76a26ad Author: Brian Dolbec gentoo org> AuthorDate: Mon Jan 4 04:44:05 2016 + Commit: Brian Dolbec gentoo org> CommitDate: Sun Jan 10 03:23:52 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=9413c11a repoman: Create new EncodingCheck class plugin pym/repoman/modules/scan/directories/__init__.py | 8 + pym/repoman/modules/scan/directories/encoding.py | 41 pym/repoman/scanner.py | 21 +--- 3 files changed, 50 insertions(+), 20 deletions(-) diff --git a/pym/repoman/modules/scan/directories/__init__.py b/pym/repoman/modules/scan/directories/__init__.py index b9daef0..548d393 100644 --- a/pym/repoman/modules/scan/directories/__init__.py +++ b/pym/repoman/modules/scan/directories/__init__.py @@ -26,6 +26,14 @@ module_spec = { 'func_kwargs': { }, }, + 'encoding-module': { + 'name': "encoding", + 'class': "EncodingCheck", + 'description': doc, + 'functions': ['check'], + 'func_kwargs': { + }, + }, } } diff --git a/pym/repoman/modules/scan/directories/encoding.py b/pym/repoman/modules/scan/directories/encoding.py new file mode 100644 index 000..0985e16 --- /dev/null +++ b/pym/repoman/modules/scan/directories/encoding.py @@ -0,0 +1,41 @@ + +import io + +from portage import _encodings +from portage import _unicode_encode + +from repoman.checks.ebuilds.checks import run_checks + + +class EncodingCheck(object): + + def __init__(self, **kwargs): + self.qatracker = kwargs.get('qatracker') + + def check(self, **kwargs): + ebuild = kwargs.get('ebuild') + pkg = kwargs.get('pkg') + try: + # All ebuilds should have utf_8 encoding. + f = io.open( + _unicode_encode(ebuild.full_path, encoding=_encodings['fs'], + errors='strict'), + mode='r', encoding=_encodings['repo.content']) + try: + for check_name, e in run_checks(f, pkg): + self.qatracker.add_error( + check_name, ebuild.relative_path + ': %s' % e) + finally: + f.close() + except UnicodeDecodeError: + # A file.UTF8 failure will have already been recorded. + pass + 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 b00dbd9..ac77d1f 100644 --- a/pym/repoman/scanner.py +++ b/pym/repoman/scanner.py @@ -3,7 +3,6 @@ from __future__ import print_function, unicode_literals import copy -import io import logging from itertools import chain from pprint import pformat @@ -13,11 +12,8 @@ from _emerge.Package import Package import portage from portage import normalize_path from portage import os -from portage import _encodings -from portage import _unicode_encode from portage.dep import Atom from portage.output import green -from repoman.checks.ebuilds.checks import run_checks from repoman.modules.commit import repochecks from repoman.profile import check_profiles, dev_profile_keywords, setup_profile from repoman.repos import repo_metadata @@ -293,7 +289,7 @@ class Scanner(object): ('arches', 'ArchChecks'), ('depend', 'DependChecks'), ('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'), ('license', 'LicenseChecks'), ('restrict', 'RestrictChecks'), - ('mtime', 'MtimeChecks'), + ('mtime', 'MtimeChecks'), ('encoding', 'EncodingCheck'), ]: if mod[0]: mod_class = MODULE_CONTROLLER.get_class(mod[0]) @@ -322,21 +318,6 @@ class Scanner(object): continue # Syntax Checks - try: - # All ebuilds should have utf_8 encoding. - f = io.open( - _unicode_encode( - dynamic_data['ebuild'].full_path, encoding=_encodings['fs'], errors='strict'), - mode='r',
[gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/
commit: 304a5064770769aa4d01bd5a5385384dae4ba681 Author: Brian Dolbec gentoo org> AuthorDate: Sun Jan 3 23:23:52 2016 + Commit: Brian Dolbec gentoo org> CommitDate: Wed Jan 6 04:08:24 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=304a5064 repoman: Migrate code to a new MtimeChecks class in directories plugin pym/repoman/modules/scan/directories/__init__.py | 8 pym/repoman/modules/scan/directories/mtime.py| 24 pym/repoman/scanner.py | 5 + 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/pym/repoman/modules/scan/directories/__init__.py b/pym/repoman/modules/scan/directories/__init__.py index 7fe9f0e..b9daef0 100644 --- a/pym/repoman/modules/scan/directories/__init__.py +++ b/pym/repoman/modules/scan/directories/__init__.py @@ -18,6 +18,14 @@ module_spec = { 'func_kwargs': { }, }, + 'mtime-module': { + 'name': "mtime", + 'class': "MtimeChecks", + 'description': doc, + 'functions': ['check'], + 'func_kwargs': { + }, + }, } } diff --git a/pym/repoman/modules/scan/directories/mtime.py b/pym/repoman/modules/scan/directories/mtime.py new file mode 100644 index 000..e113cdd --- /dev/null +++ b/pym/repoman/modules/scan/directories/mtime.py @@ -0,0 +1,24 @@ + + +class MtimeChecks(object): + + def __init__(self, **kwargs): + self.vcs_settings = kwargs.get('vcs_settings') + + def check(self, **kwargs): + ebuild = kwargs.get('ebuild') + changed = kwargs.get('changed') + pkg = kwargs.get('pkg') + if not self.vcs_settings.vcs_preserves_mtime: + if ebuild.ebuild_path not in changed.new_ebuilds and \ + ebuild.ebuild_path not in changed.ebuilds: + pkg.mtime = None + 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 457bdcb..7640dca 100644 --- a/pym/repoman/scanner.py +++ b/pym/repoman/scanner.py @@ -295,6 +295,7 @@ class Scanner(object): ('arches', 'ArchChecks'), ('depend', 'DependChecks'), ('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'), ('license', 'LicenseChecks'), ('restrict', 'RestrictChecks'), + ('mtime', 'MtimeChecks'), ]: if mod[0]: mod_class = MODULE_CONTROLLER.get_class(mod[0]) @@ -326,10 +327,6 @@ class Scanner(object): print(" finished plugin loop, continuing...") # Syntax Checks - if not self.vcs_settings.vcs_preserves_mtime: - if dynamic_data['ebuild'].ebuild_path not in self.changed.new_ebuilds and \ - dynamic_data['ebuild'].ebuild_path not in self.changed.ebuilds: - dynamic_data['pkg'].mtime = None try: # All ebuilds should have utf_8 encoding. f = io.open(