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 6A95E1381FA for ; Wed, 4 Jun 2014 13:59:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EEAA9E09C6; Wed, 4 Jun 2014 13:59:32 +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 70B5AE09C6 for ; Wed, 4 Jun 2014 13:59:32 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 38E8A33FB81 for ; Wed, 4 Jun 2014 13:59:31 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id CD209181A9 for ; Wed, 4 Jun 2014 13:59:29 +0000 (UTC) From: "Tom Wijsman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Tom Wijsman" Message-ID: <1401890311.1a1e2aa4e650283004fd9cba23c084b111a70115.tomwij@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: tomwij X-VCS-Committer-Name: Tom Wijsman X-VCS-Revision: 1a1e2aa4e650283004fd9cba23c084b111a70115 X-VCS-Branch: repoman Date: Wed, 4 Jun 2014 13:59:29 +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: e3721773-80e3-4e75-b4d9-14c4dded82a2 X-Archives-Hash: cde4d3735a2e4496991702c4bd32aa56 commit: 1a1e2aa4e650283004fd9cba23c084b111a70115 Author: Tom Wijsman gentoo org> AuthorDate: Wed Jun 4 13:58:31 2014 +0000 Commit: Tom Wijsman gentoo 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: