From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-868998-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 8125159CA4 for <garchives@archives.gentoo.org>; Fri, 11 Mar 2016 00:41:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1D04A21C038; Fri, 11 Mar 2016 00:41:10 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6845421C019 for <gentoo-commits@lists.gentoo.org>; Fri, 11 Mar 2016 00:41:09 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 42860340C25 for <gentoo-commits@lists.gentoo.org>; Fri, 11 Mar 2016 00:41:07 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 421402324 for <gentoo-commits@lists.gentoo.org>; Fri, 11 Mar 2016 00:41:05 +0000 (UTC) From: "Brian Dolbec" <dolsen@gentoo.org> 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" <dolsen@gentoo.org> Message-ID: <1457653655.5136e5575803b3f2180b49a9f3dff1f51296d6b0.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: 5136e5575803b3f2180b49a9f3dff1f51296d6b0 X-VCS-Branch: repoman Date: Fri, 11 Mar 2016 00:41:05 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a54cbafe-afc4-490e-ae33-6bf010473e89 X-Archives-Hash: de1d4715cbbb6acea27a706070f4b8ad commit: 5136e5575803b3f2180b49a9f3dff1f51296d6b0 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> AuthorDate: Sun Jan 3 23:23:52 2016 +0000 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> CommitDate: Thu Mar 10 23:47:35 2016 +0000 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 0000000..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(