From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/
Date: Wed, 6 Jan 2016 04:21:52 +0000 (UTC) [thread overview]
Message-ID: <1452053304.304a5064770769aa4d01bd5a5385384dae4ba681.dolsen@gentoo> (raw)
commit: 304a5064770769aa4d01bd5a5385384dae4ba681
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: 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(
next reply other threads:[~2016-01-06 4:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-06 4:21 Brian Dolbec [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-01-10 3:26 [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/directories/, pym/repoman/ Brian Dolbec
2016-01-11 6:31 Brian Dolbec
2016-01-11 8:01 Brian Dolbec
2016-01-18 19:23 Brian Dolbec
2016-01-18 19:23 Brian Dolbec
2016-01-21 18:30 Brian Dolbec
2016-01-22 20:55 Brian Dolbec
2016-01-27 23:15 Brian Dolbec
2016-01-29 5:01 Brian Dolbec
2016-01-30 6:58 Brian Dolbec
2016-01-30 8:00 Brian Dolbec
2016-01-31 20:03 Brian Dolbec
2016-03-11 0:41 Brian Dolbec
2016-03-12 18:10 Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1452053304.304a5064770769aa4d01bd5a5385384dae4ba681.dolsen@gentoo \
--to=dolsen@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox