From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id B239B1388BF for ; Wed, 6 Jan 2016 04:22:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9676221C01E; Wed, 6 Jan 2016 04:21:58 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 851C621C012 for ; Wed, 6 Jan 2016 04:21:56 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CB727340A4A for ; Wed, 6 Jan 2016 04:21:55 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 389CAE54 for ; Wed, 6 Jan 2016 04:21:52 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1452053304.304a5064770769aa4d01bd5a5385384dae4ba681.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/ X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/modules/scan/directories/__init__.py pym/repoman/modules/scan/directories/mtime.py pym/repoman/scanner.py X-VCS-Directories: pym/repoman/modules/scan/directories/ pym/repoman/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 304a5064770769aa4d01bd5a5385384dae4ba681 X-VCS-Branch: repoman Date: Wed, 6 Jan 2016 04:21:52 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 1d93add0-eb0c-4284-a718-c2737ed72255 X-Archives-Hash: a225b96cd401095077ebc085214f3e86 commit: 304a5064770769aa4d01bd5a5385384dae4ba681 Author: Brian Dolbec gentoo org> AuthorDate: Sun Jan 3 23:23:52 2016 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Wed Jan 6 04:08:24 2016 +0000 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 0000000..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(