From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/directories/
Date: Sun, 10 Jan 2016 20:17:12 +0000 (UTC) [thread overview]
Message-ID: <1452456908.ed9f7a5e850c9954ea5cacec332c30807e0cbd6b.dolsen@gentoo> (raw)
commit: ed9f7a5e850c9954ea5cacec332c30807e0cbd6b
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: Sun Jan 10 20:15:08 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ed9f7a5e
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 8657c73..b00dbd9 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -293,6 +293,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])
@@ -321,10 +322,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(
next reply other threads:[~2016-01-10 20:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-10 20:17 Brian Dolbec [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-03-07 21:53 [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/directories/ Brian Dolbec
2016-01-23 1:42 Brian Dolbec
2016-01-11 8:01 Brian Dolbec
2016-01-11 6:31 Brian Dolbec
2016-01-10 20:17 Brian Dolbec
2016-01-10 3:26 Brian Dolbec
2016-01-06 4:21 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=1452456908.ed9f7a5e850c9954ea5cacec332c30807e0cbd6b.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