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 F042B138206 for ; Thu, 28 Apr 2016 05:13:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 686AD21C018; Thu, 28 Apr 2016 05:13:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E950521C018 for ; Thu, 28 Apr 2016 05:13:22 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 353F6340C8A for ; Thu, 28 Apr 2016 05:13:21 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5265315F for ; Thu, 28 Apr 2016 05:13:18 +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: <1461820317.1521249252e81eb4eff9c37f498b51c52199592d.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/metadata/, pym/repoman/modules/scan/eclasses/, ... X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/modules/scan/ebuild/ebuild.py pym/repoman/modules/scan/eclasses/__init__.py pym/repoman/modules/scan/eclasses/live.py pym/repoman/modules/scan/keywords/__init__.py pym/repoman/modules/scan/keywords/keywords.py pym/repoman/modules/scan/metadata/__init__.py pym/repoman/modules/scan/metadata/ebuild_metadata.py X-VCS-Directories: pym/repoman/modules/scan/metadata/ pym/repoman/modules/scan/ebuild/ pym/repoman/modules/scan/keywords/ pym/repoman/modules/scan/eclasses/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 1521249252e81eb4eff9c37f498b51c52199592d X-VCS-Branch: repoman Date: Thu, 28 Apr 2016 05:13:18 +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: 3c63757b-2776-471c-9525-0bc8ccc0bbf0 X-Archives-Hash: 21f75a5bb00db0d1e68302770c9c1694 commit: 1521249252e81eb4eff9c37f498b51c52199592d Author: Brian Dolbec gentoo org> AuthorDate: Thu Apr 28 05:11:57 2016 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Thu Apr 28 05:11:57 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=15212492 repoman: Move the LiveEclasses.is_live() to the Ebuild class This removes another dynaic_data variable. It also belongs with the ebuild eclass as a primary source for that type of data. pym/repoman/modules/scan/ebuild/ebuild.py | 9 +++++++++ pym/repoman/modules/scan/eclasses/__init__.py | 1 - pym/repoman/modules/scan/eclasses/live.py | 22 +++------------------- pym/repoman/modules/scan/keywords/__init__.py | 1 - pym/repoman/modules/scan/keywords/keywords.py | 8 +++----- pym/repoman/modules/scan/metadata/__init__.py | 1 - .../modules/scan/metadata/ebuild_metadata.py | 3 +-- 7 files changed, 16 insertions(+), 29 deletions(-) diff --git a/pym/repoman/modules/scan/ebuild/ebuild.py b/pym/repoman/modules/scan/ebuild/ebuild.py index c247a7f..0277aa9 100644 --- a/pym/repoman/modules/scan/ebuild/ebuild.py +++ b/pym/repoman/modules/scan/ebuild/ebuild.py @@ -13,6 +13,7 @@ from repoman.qa_data import no_exec, allvars # import our initialized portage instance from repoman._portage import portage from portage import os +from portage.const import LIVE_ECLASSES pv_toolong_re = re.compile(r'[0-9]{19,}') @@ -220,6 +221,14 @@ class Ebuild(ScanBase): return self.continue_ @property + def is_live(self): + '''Test if the ebuild inherits a live eclass + + @returns: boolean + ''' + return set(LIVE_ECLASSES.intersection(self.inherited)) + + @property def runInPkgs(self): '''Package level scans''' return (True, [self.check_isebuild]) diff --git a/pym/repoman/modules/scan/eclasses/__init__.py b/pym/repoman/modules/scan/eclasses/__init__.py index 63bb86f..78d46e4 100644 --- a/pym/repoman/modules/scan/eclasses/__init__.py +++ b/pym/repoman/modules/scan/eclasses/__init__.py @@ -22,7 +22,6 @@ module_spec = { ], 'func_kwargs': { 'ebuild': (None, None), - 'live_ebuild': ('Future', 'UNSET'), 'pkg': (None, None), 'xpkg': (None, None), 'y_ebuild': (None, None), diff --git a/pym/repoman/modules/scan/eclasses/live.py b/pym/repoman/modules/scan/eclasses/live.py index 842cbab..1ce33c0 100644 --- a/pym/repoman/modules/scan/eclasses/live.py +++ b/pym/repoman/modules/scan/eclasses/live.py @@ -6,8 +6,6 @@ Performs Live eclass checks from repoman._portage import portage from repoman.modules.scan.scanbase import ScanBase -from portage.const import LIVE_ECLASSES - class LiveEclassChecks(ScanBase): '''Performs checks for the usage of Live eclasses in ebuilds''' @@ -20,27 +18,14 @@ class LiveEclassChecks(ScanBase): self.pmaskdict = kwargs.get('repo_metadata')['pmaskdict'] self.repo_settings = kwargs.get('repo_settings') - def is_live(self, **kwargs): - '''Test if the ebuild inherits a live eclass - - @returns: dictionary, including {live_ebuild} - ''' - ebuild = kwargs.get('ebuild').get() - # update the dynamic data - dyn_live = kwargs.get('live_ebuild') - dyn_live.set(LIVE_ECLASSES.intersection(ebuild.inherited)) - return False - def check(self, **kwargs): '''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 xpkg: 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. @returns: dictionary ''' pkg = kwargs.get("pkg").result() @@ -48,9 +33,8 @@ class LiveEclassChecks(ScanBase): ebuild = kwargs.get('ebuild').get() y_ebuild = kwargs.get('y_ebuild') keywords = ebuild.keywords - live_ebuild = kwargs.get('live_ebuild').get() - if not live_ebuild and self.repo_settings.repo_config.name == "gentoo": + if not ebuild.is_live and self.repo_settings.repo_config.name == "gentoo": return False is_stable = lambda kw: not kw.startswith("~") and not kw.startswith("-") @@ -79,4 +63,4 @@ class LiveEclassChecks(ScanBase): @property def runInEbuilds(self): '''Ebuild level scans''' - return (True, [self.is_live, self.check]) + return (True, [self.check]) diff --git a/pym/repoman/modules/scan/keywords/__init__.py b/pym/repoman/modules/scan/keywords/__init__.py index 1c424ca..2223927 100644 --- a/pym/repoman/modules/scan/keywords/__init__.py +++ b/pym/repoman/modules/scan/keywords/__init__.py @@ -23,7 +23,6 @@ module_spec = { 'func_kwargs': { 'changed': (None, None), 'ebuild': ('Future', 'UNSET'), - 'live_ebuild': ('Future', 'UNSET'), 'pkg': ('Future', 'UNSET'), 'xpkg': None, 'y_ebuild': (None, None), diff --git a/pym/repoman/modules/scan/keywords/keywords.py b/pym/repoman/modules/scan/keywords/keywords.py index af94c6f..c3c8058 100644 --- a/pym/repoman/modules/scan/keywords/keywords.py +++ b/pym/repoman/modules/scan/keywords/keywords.py @@ -37,7 +37,6 @@ class KeywordChecks(ScanBase): @param y_ebuild: Ebuild which we check (string). @param ebuild_archs: Just the architectures (no prefixes) of the ebuild. @param changed: Changes instance - @param live_ebuild: A boolean that determines if this is a live ebuild. @returns: dictionary ''' pkg = kwargs.get('pkg').get() @@ -45,12 +44,11 @@ class KeywordChecks(ScanBase): ebuild = kwargs.get('ebuild').get() y_ebuild = kwargs.get('y_ebuild') changed = kwargs.get('changed') - live_ebuild = kwargs.get('live_ebuild').get() if not self.options.straight_to_stable: self._checkAddedWithStableKeywords( xpkg, ebuild, y_ebuild, ebuild.keywords, changed) - self._checkForDroppedKeywords(pkg, ebuild, ebuild.archs, live_ebuild) + self._checkForDroppedKeywords(pkg, ebuild, ebuild.archs) self._checkForInvalidKeywords(ebuild, xpkg, y_ebuild) @@ -77,11 +75,11 @@ class KeywordChecks(ScanBase): (package, y_ebuild, " ".join(stable_keywords))) def _checkForDroppedKeywords( - self, pkg, ebuild, ebuild_archs, live_ebuild): + self, pkg, ebuild, ebuild_archs): previous_keywords = self.slot_keywords.get(pkg.slot) if previous_keywords is None: self.slot_keywords[pkg.slot] = set() - elif ebuild_archs and "*" not in ebuild_archs and not live_ebuild: + elif ebuild_archs and "*" not in ebuild_archs and not ebuild.is_live: dropped_keywords = previous_keywords.difference(ebuild_archs) if dropped_keywords: self.qatracker.add_error( diff --git a/pym/repoman/modules/scan/metadata/__init__.py b/pym/repoman/modules/scan/metadata/__init__.py index b090d6b..b656d7a 100644 --- a/pym/repoman/modules/scan/metadata/__init__.py +++ b/pym/repoman/modules/scan/metadata/__init__.py @@ -45,7 +45,6 @@ module_spec = { 'func_kwargs': { 'catdir': (None, None), 'ebuild': (None, None), - 'live_ebuild': (None, None), 'xpkg': (None, None), 'y_ebuild': (None, None), }, diff --git a/pym/repoman/modules/scan/metadata/ebuild_metadata.py b/pym/repoman/modules/scan/metadata/ebuild_metadata.py index e239b47..bbccedf 100644 --- a/pym/repoman/modules/scan/metadata/ebuild_metadata.py +++ b/pym/repoman/modules/scan/metadata/ebuild_metadata.py @@ -35,13 +35,12 @@ class EbuildMetadata(ScanBase): def missing(self, **kwargs): ebuild = kwargs.get('ebuild').get() - live_ebuild = kwargs.get('live_ebuild').get() for pos, missing_var in enumerate(missingvars): if not ebuild.metadata.get(missing_var): if kwargs.get('catdir') == "virtual" and \ missing_var in ("HOMEPAGE", "LICENSE"): continue - if live_ebuild and missing_var == "KEYWORDS": + if ebuild.is_live and missing_var == "KEYWORDS": continue myqakey = missingvars[pos] + ".missing" self.qatracker.add_error(myqakey, '%s/%s.ebuild'