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 00C2C59CA3 for ; Mon, 7 Mar 2016 21:53:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0424921C04B; Mon, 7 Mar 2016 21:53:26 +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 1489621C04B for ; Mon, 7 Mar 2016 21:53:25 +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 1EA39340976 for ; Mon, 7 Mar 2016 21:53:24 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3B43E209C for ; Mon, 7 Mar 2016 21:53:20 +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: <1457385655.dd2be6987e095001bb23280f2d76cfe0122822c2.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/directories/ 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: dd2be6987e095001bb23280f2d76cfe0122822c2 X-VCS-Branch: repoman Date: Mon, 7 Mar 2016 21:53:20 +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: 984dc8da-395c-4f71-9a4b-fdf494a54931 X-Archives-Hash: e95ef0353a091915a22644c8ecf9ed5d commit: dd2be6987e095001bb23280f2d76cfe0122822c2 Author: Brian Dolbec gentoo org> AuthorDate: Sun Jan 3 23:23:52 2016 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Mon Mar 7 21:20:55 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=dd2be698 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 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(