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 936621384C3 for ; Sat, 5 Sep 2015 21:48:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B253214328; Sat, 5 Sep 2015 21:48:18 +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 9D2441432B for ; Sat, 5 Sep 2015 21:48:17 +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 B7D43340A08 for ; Sat, 5 Sep 2015 21:48:11 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3AE1F196 for ; Sat, 5 Sep 2015 21:48:08 +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: <1441489657.f58cea2bd71b571e0ff49f6284d5d76fdbed446f.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/live.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: f58cea2bd71b571e0ff49f6284d5d76fdbed446f X-VCS-Branch: repoman Date: Sat, 5 Sep 2015 21:48:08 +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: 496ddae8-5de6-459c-9577-8d1632657df6 X-Archives-Hash: 7a49725cfce7dc753e348255834ededf commit: f58cea2bd71b571e0ff49f6284d5d76fdbed446f Author: Tom Wijsman gentoo org> AuthorDate: Wed Jun 4 13:40:35 2014 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Sat Sep 5 21:47:37 2015 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f58cea2b 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 6e9dc22..305e0b1 100755 --- a/pym/repoman/main.py +++ b/pym/repoman/main.py @@ -50,6 +50,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 @@ -63,16 +64,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 @@ -274,18 +276,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, options) +liveeclasscheck = LiveEclassChecks(qatracker) +###################### for xpkg in effective_scanlist: # ebuilds and digests added to cvs respectively. @@ -454,25 +459,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 = [[