From: "Tom Wijsman" <tomwij@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/eclasses/
Date: Wed, 4 Jun 2014 13:59:29 +0000 (UTC) [thread overview]
Message-ID: <1401890311.1a1e2aa4e650283004fd9cba23c084b111a70115.tomwij@gentoo> (raw)
commit: 1a1e2aa4e650283004fd9cba23c084b111a70115
Author: Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 4 13:58:31 2014 +0000
Commit: Tom Wijsman <tomwij <AT> gentoo <DOT> org>
CommitDate: Wed Jun 4 13:58:31 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1a1e2aa4
repoman/main.py: Split Ruby checks to checks/ebuild/eclass/ruby.py
---
pym/repoman/checks/ebuilds/eclasses/__init__.py | 0
pym/repoman/checks/ebuilds/eclasses/ruby.py | 32 +++++++++++++++++++++++++
pym/repoman/main.py | 18 ++++----------
3 files changed, 37 insertions(+), 13 deletions(-)
diff --git a/pym/repoman/checks/ebuilds/eclasses/__init__.py b/pym/repoman/checks/ebuilds/eclasses/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/pym/repoman/checks/ebuilds/eclasses/ruby.py b/pym/repoman/checks/ebuilds/eclasses/ruby.py
new file mode 100644
index 0000000..abfb166
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/eclasses/ruby.py
@@ -0,0 +1,32 @@
+
+'''live.py
+Performs Ruby eclass checks
+'''
+
+from repoman.qa_data import ruby_deprecated
+
+
+class RubyEclassChecks(object):
+ '''Performs checks for the usage of Ruby eclasses in ebuilds'''
+
+ def __init__(self, qatracker):
+ '''
+ @param qatracker: QATracker instance
+ '''
+ self.qatracker = qatracker
+ self.old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
+
+ def check(self, pkg, ebuild):
+ is_inherited = lambda eclass: eclass in pkg.inherited
+ is_old_ruby_eclass_inherited = filter(
+ is_inherited, self.old_ruby_eclasses)
+
+ if is_old_ruby_eclass_inherited:
+ ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
+
+ if ruby_intersection:
+ for myruby in ruby_intersection:
+ self.qatracker.add_error(
+ "IUSE.rubydeprecated",
+ (ebuild.relative_path + ": Deprecated ruby target: %s")
+ % myruby)
\ No newline at end of file
diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index eb083ca..5762abd 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -42,6 +42,7 @@ from repoman.argparser import parse_args
from repoman.checks.directories.files import FileChecks
from repoman.checks.ebuilds.checks import run_checks, checks_init
from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
+from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
from repoman.checks.ebuilds.fetches import FetchChecks
from repoman.checks.ebuilds.keywords import KeywordChecks
from repoman.checks.ebuilds.isebuild import IsEbuild
@@ -57,7 +58,7 @@ from repoman.profile import check_profiles, dev_keywords, setup_profile
from repoman.qa_data import (
format_qa_output, format_qa_output_column, qahelp,
qawarnings, qacats, max_desc_len, missingvars,
- ruby_deprecated, suspect_virtual, suspect_rdepend, valid_restrict)
+ suspect_virtual, suspect_rdepend, valid_restrict)
from repoman.qa_tracker import QATracker
from repoman.repos import RepoSettings, repo_metadata
from repoman.scan import Changes, scan
@@ -280,6 +281,7 @@ thirdparty = ThirdPartyMirrors(repoman_settings, qatracker)
use_flag_checks = USEFlagChecks(qatracker, uselist)
keywordcheck = KeywordChecks(qatracker)
liveeclasscheck = LiveEclassChecks(qatracker)
+rubyeclasscheck = RubyEclassChecks(qatracker)
######################
for xpkg in effective_scanlist:
@@ -600,18 +602,8 @@ for xpkg in effective_scanlist:
ebuild_used_useflags = use_flag_checks.getUsedUseFlags()
used_useflags = used_useflags.union(ebuild_used_useflags)
#################
-
- # Check for outdated RUBY targets
- old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
- is_old_ruby_eclass_inherited = filter(
- lambda e: e in inherited, old_ruby_eclasses)
- if is_old_ruby_eclass_inherited:
- ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
- if ruby_intersection:
- for myruby in ruby_intersection:
- qatracker.add_error("IUSE.rubydeprecated",
- (ebuild.relative_path + ": Deprecated ruby target: %s")
- % myruby)
+ rubyeclasscheck.check(pkg, ebuild)
+ #################
# license checks
if not badlicsyntax:
next reply other threads:[~2014-06-04 13:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-04 13:59 Tom Wijsman [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-09-21 23:51 [gentoo-commits] proj/portage:master commit in: pym/repoman/checks/ebuilds/eclasses/, pym/repoman/ Brian Dolbec
2015-09-21 23:47 ` [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/eclasses/ Brian Dolbec
2015-09-17 4:51 Brian Dolbec
2015-09-17 3:08 Brian Dolbec
2015-09-05 21:48 Brian Dolbec
2015-09-05 21:48 Brian Dolbec
2015-09-05 21:27 Brian Dolbec
2015-08-11 23:54 Brian Dolbec
2015-08-11 23:54 Brian Dolbec
2015-08-10 14:45 Michał Górny
2014-10-01 23:46 Brian Dolbec
2014-10-01 23:46 Brian Dolbec
2014-10-01 23:02 Brian Dolbec
2014-10-01 23:02 Brian Dolbec
2014-06-04 13:41 Tom Wijsman
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=1401890311.1a1e2aa4e650283004fd9cba23c084b111a70115.tomwij@gentoo \
--to=tomwij@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