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 52E6658973 for ; Sat, 30 Jan 2016 06:59:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CFEB021C067; Sat, 30 Jan 2016 06:59:01 +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 25E6821C04B for ; Sat, 30 Jan 2016 06:59:00 +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 5EBA3340CDA for ; Sat, 30 Jan 2016 06:58:59 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A1E7ED01 for ; Sat, 30 Jan 2016 06:58:54 +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: <1454136717.196ac80c1b39d6f5b795b7cbd56c735eeac6414c.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/ pym/repoman/modules/scan/directories/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 196ac80c1b39d6f5b795b7cbd56c735eeac6414c X-VCS-Branch: repoman Date: Sat, 30 Jan 2016 06:58:54 +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: 77996e86-2dfb-423c-a141-cd073a69d30b X-Archives-Hash: 2404ba2845fbc4c347ef6c3df10527ef commit: 196ac80c1b39d6f5b795b7cbd56c735eeac6414c Author: Brian Dolbec gentoo org> AuthorDate: Sun Jan 3 23:23:52 2016 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Sat Jan 30 06:51:57 2016 +0000 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 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 dcb955c..dbbbb15 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(