From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/options/, pym/repoman/
Date: Mon, 7 Mar 2016 21:53:20 +0000 (UTC) [thread overview]
Message-ID: <1457385671.2290fc1382ac8051f595187bda03dc25fcb3b6fb.dolsen@gentoo> (raw)
commit: 2290fc1382ac8051f595187bda03dc25fcb3b6fb
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 4 07:55:55 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Mar 7 21:21:11 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=2290fc13
repoman: Create a new Options class plugin
This handles an options.force bypass using the is_forced() from withing the plugin system.
pym/repoman/modules/scan/options/__init__.py | 24 ++++++++++++++++++++++++
pym/repoman/modules/scan/options/options.py | 18 ++++++++++++++++++
pym/repoman/scanner.py | 10 ++--------
3 files changed, 44 insertions(+), 8 deletions(-)
diff --git a/pym/repoman/modules/scan/options/__init__.py b/pym/repoman/modules/scan/options/__init__.py
new file mode 100644
index 0000000..2d3d9d2
--- /dev/null
+++ b/pym/repoman/modules/scan/options/__init__.py
@@ -0,0 +1,24 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Options plug-in module for repoman.
+Performs option related actions on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+ 'name': 'options',
+ 'description': doc,
+ 'provides':{
+ 'options-module': {
+ 'name': "options",
+ 'sourcefile': "options",
+ 'class': "Options",
+ 'description': doc,
+ 'functions': ['is_forced'],
+ 'func_desc': {
+ },
+ },
+ }
+}
+
diff --git a/pym/repoman/modules/scan/options/options.py b/pym/repoman/modules/scan/options/options.py
new file mode 100644
index 0000000..c2546d6
--- /dev/null
+++ b/pym/repoman/modules/scan/options/options.py
@@ -0,0 +1,18 @@
+
+
+class Options(object):
+
+ def __init__(self, **kwargs):
+ self.options = kwargs.get('options')
+
+ def is_forced(self, **kwargs):
+ if self.options.force:
+ # The dep_check() calls are the most expensive QA test. If --force
+ # is enabled, there's no point in wasting time on these since the
+ # user is intent on forcing the commit anyway.
+ return {'continue': True}
+ return {'continue': False}
+
+ @property
+ def runInEbuilds(self):
+ return (True, [self.is_forced])
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 78ff053..2625de4 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -291,6 +291,8 @@ class Scanner(object):
('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'),
('license', 'LicenseChecks'), ('restrict', 'RestrictChecks'),
('mtime', 'MtimeChecks'), ('multicheck', 'MultiCheck'),
+ # Options.is_forced() is used to bypass further checks
+ ('options', 'Options'),
]:
if mod[0]:
mod_class = MODULE_CONTROLLER.get_class(mod[0])
@@ -318,14 +320,6 @@ class Scanner(object):
if y_ebuild_continue:
continue
- # Syntax Checks
-
- if self.options.force:
- # The dep_check() calls are the most expensive QA test. If --force
- # is enabled, there's no point in wasting time on these since the
- # user is intent on forcing the commit anyway.
- continue
-
relevant_profiles = []
for keyword, arch, groups in dynamic_data['arches']:
if arch not in self.profiles:
next reply other threads:[~2016-03-07 21:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-07 21:53 Brian Dolbec [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-03-11 0:41 [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/options/, pym/repoman/ Brian Dolbec
2016-01-30 8:00 Brian Dolbec
2016-01-30 6:58 Brian Dolbec
2016-01-29 5:01 Brian Dolbec
2016-01-27 23:15 Brian Dolbec
2016-01-23 1:42 Brian Dolbec
2016-01-11 8:01 Brian Dolbec
2016-01-10 20:17 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=1457385671.2290fc1382ac8051f595187bda03dc25fcb3b6fb.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