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 E9AFC13838B for ; Wed, 1 Oct 2014 23:02:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 906B2E086F; Wed, 1 Oct 2014 23:02:40 +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 60E86E0866 for ; Wed, 1 Oct 2014 23:02:39 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 06B97340358 for ; Wed, 1 Oct 2014 23:02:38 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 21F806B86 for ; Wed, 1 Oct 2014 23:02:34 +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: <1412204294.97130432a87ca75e6766bc80615d28afb21c4d32.dol-sen@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/live.py pym/repoman/main.py X-VCS-Directories: pym/repoman/ pym/repoman/checks/ebuilds/eclasses/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 97130432a87ca75e6766bc80615d28afb21c4d32 X-VCS-Branch: repoman Date: Wed, 1 Oct 2014 23:02:34 +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: 4881bf2e-4d43-479a-8cb8-1fce496e62a6 X-Archives-Hash: 73e15f4a616aa65bf6c5bcc8709cad00 commit: 97130432a87ca75e6766bc80615d28afb21c4d32 Author: Tom Wijsman gentoo org> AuthorDate: Wed Jun 4 13:40:35 2014 +0000 Commit: Brian Dolbec gmail com> CommitDate: Wed Oct 1 22:58:14 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=97130432 repoman/main.py: Split "Live" checks to checks/ebuilds/eclass/live.py --- pym/repoman/checks/ebuilds/eclasses/live.py | 39 +++++++++++++++++++++++++ pym/repoman/main.py | 45 ++++++++++++----------------- 2 files changed, 57 insertions(+), 27 deletions(-) diff --git a/pym/repoman/checks/ebuilds/eclasses/live.py b/pym/repoman/checks/ebuilds/eclasses/live.py new file mode 100644 index 0000000..20c573e --- /dev/null +++ b/pym/repoman/checks/ebuilds/eclasses/live.py @@ -0,0 +1,39 @@ + +'''live.py +Performs Live eclass checks +''' + +from repoman.repos import has_global_mask + + +class LiveEclassChecks(object): + '''Performs checks for the usage of Live eclasses in ebuilds''' + + def __init__(self, qatracker): + ''' + @param qatracker: QATracker instance + ''' + self.qatracker = qatracker + + def check(self, pkg, package, ebuild, y_ebuild, keywords, global_pmaskdict): + '''Ebuilds that inherit a "Live" eclass (darcs, subversion, git, cvs, + etc..) should not be allowed to be marked stable + + @param pkg: Package in which we check (object). + @param package: Package in which we check (string). + @param ebuild: Ebuild which we check (object). + @param y_ebuild: Ebuild which we check (string). + @param keywords: The keywords of the ebuild. + @param global_pmaskdict: A global dictionary of all the masks. + ''' + is_stable = lambda kw: not kw.startswith("~") and not kw.startswith("-") + bad_stable_keywords = list(filter(is_stable, keywords)) + + if bad_stable_keywords: + self.qatracker.add_error( + "LIVEVCS.stable", "%s/%s.ebuild with stable keywords:%s " % ( + package, y_ebuild, bad_stable_keywords)) + + good_keywords_exist = len(bad_stable_keywords) < len(keywords) + if good_keywords_exist and not has_global_mask(pkg, global_pmaskdict): + self.qatracker.add_error("LIVEVCS.unmasked", ebuild.relative_path) \ No newline at end of file diff --git a/pym/repoman/main.py b/pym/repoman/main.py index 05d9a14..2cd89b2 100755 --- a/pym/repoman/main.py +++ b/pym/repoman/main.py @@ -48,6 +48,7 @@ from portage.package.ebuild.digestgen import digestgen 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.fetches import FetchChecks from repoman.checks.ebuilds.keywords import KeywordChecks from repoman.checks.ebuilds.isebuild import IsEbuild @@ -60,16 +61,17 @@ from repoman.ebuild import Ebuild from repoman.errors import err from repoman.modules.commit import repochecks from repoman.profile import check_profiles, dev_keywords, setup_profile -from repoman.qa_data import (format_qa_output, format_qa_output_column, qahelp, +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) from repoman.qa_tracker import QATracker -from repoman.repos import has_global_mask, RepoSettings, repo_metadata +from repoman.repos import RepoSettings, repo_metadata from repoman.scan import Changes, scan from repoman._subprocess import repoman_popen, repoman_getstatusoutput from repoman import utilities -from repoman.vcs.vcs import (git_supports_gpg_sign, vcs_files_to_cps, - VCSSettings) +from repoman.vcs.vcs import ( + git_supports_gpg_sign, vcs_files_to_cps, VCSSettings) from repoman.vcs.vcsstatus import VCSStatus @@ -271,18 +273,21 @@ if options.if_modified == "y": chain(changed.changed, changed.new, changed.removed), repolevel, reposplit, categories)) -####### initialize our checks classes here before the big xpkg loop +###################### +# initialize our checks classes here before the big xpkg loop manifester = Manifests(options, qatracker, repoman_settings) is_ebuild = IsEbuild(repoman_settings, repo_settings, portdb, qatracker) -filescheck = FileChecks(qatracker, repoman_settings, repo_settings, portdb, - vcs_settings) +filescheck = FileChecks( + qatracker, repoman_settings, repo_settings, portdb, vcs_settings) status_check = VCSStatus(vcs_settings, qatracker) -fetchcheck = FetchChecks(qatracker, repoman_settings, repo_settings, portdb, - vcs_settings) +fetchcheck = FetchChecks( + qatracker, repoman_settings, repo_settings, portdb, vcs_settings) pkgmeta = PkgMetadata(options, qatracker, repoman_settings) thirdparty = ThirdPartyMirrors(repoman_settings, qatracker) use_flag_checks = USEFlagChecks(qatracker, uselist) keywordcheck = KeywordChecks(qatracker) +liveeclasscheck = LiveEclassChecks(qatracker) +###################### for xpkg in effective_scanlist: # ebuilds and digests added to cvs respectively. @@ -451,25 +456,11 @@ for xpkg in effective_scanlist: qatracker.add_error("KEYWORDS.stupid", xpkg + "/" + y_ebuild + ".ebuild") - """ - Ebuilds that inherit a "Live" eclass (darcs,subversion,git,cvs,etc..) should - not be allowed to be marked stable - """ if live_ebuild and repo_settings.repo_config.name == "gentoo": - bad_stable_keywords = [] - for keyword in keywords: - if not keyword.startswith("~") and \ - not keyword.startswith("-"): - bad_stable_keywords.append(keyword) - del keyword - if bad_stable_keywords: - qatracker.add_error("LIVEVCS.stable", - "%s/%s.ebuild with stable keywords:%s " % - (xpkg, y_ebuild, bad_stable_keywords)) - del bad_stable_keywords - - if keywords and not has_global_mask(pkg, global_pmaskdict): - qatracker.add_error("LIVEVCS.unmasked", ebuild.relative_path) + ####################### + liveeclasscheck.check( + pkg, xpkg, ebuild, y_ebuild, keywords, global_pmaskdict) + ####################### if options.ignore_arches: arches = [[