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 5A6A7139737 for ; Tue, 11 Aug 2015 23:54:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A6BB2141B8; Tue, 11 Aug 2015 23:54:14 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D3353141AD for ; Tue, 11 Aug 2015 23:54:13 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0AEE2340A0E for ; Tue, 11 Aug 2015 23:54:13 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2276B15D for ; Tue, 11 Aug 2015 23:54:09 +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: <1439337175.81a1ca3d16b54f13e5b7fd5b20c09c3b22d05279.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/eclasses/ X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/checks/ebuilds/eclasses/__init__.py pym/repoman/checks/ebuilds/eclasses/ruby.py pym/repoman/main.py X-VCS-Directories: pym/repoman/ pym/repoman/checks/ebuilds/eclasses/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 81a1ca3d16b54f13e5b7fd5b20c09c3b22d05279 X-VCS-Branch: repoman Date: Tue, 11 Aug 2015 23:54:09 +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: 06eecda6-f95c-4173-83ba-819938a068fd X-Archives-Hash: 8c166650fdb6c60e429d19ea2da0b155 commit: 81a1ca3d16b54f13e5b7fd5b20c09c3b22d05279 Author: Tom Wijsman gentoo org> AuthorDate: Wed Jun 4 13:58:31 2014 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Tue Aug 11 23:52:55 2015 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=81a1ca3d 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 f8a4993..bcd2174 100755 --- a/pym/repoman/main.py +++ b/pym/repoman/main.py @@ -51,6 +51,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 @@ -67,7 +68,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 @@ -290,6 +291,7 @@ thirdparty = ThirdPartyMirrors(repoman_settings, qatracker) use_flag_checks = USEFlagChecks(qatracker, uselist) keywordcheck = KeywordChecks(qatracker, options) liveeclasscheck = LiveEclassChecks(qatracker) +rubyeclasscheck = RubyEclassChecks(qatracker) ###################### for xpkg in effective_scanlist: @@ -615,18 +617,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: