From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/metadata/, pym/repoman/modules/scan/eclasses/, ...
Date: Thu, 28 Apr 2016 05:13:18 +0000 (UTC) [thread overview]
Message-ID: <1461820317.1521249252e81eb4eff9c37f498b51c52199592d.dolsen@gentoo> (raw)
commit: 1521249252e81eb4eff9c37f498b51c52199592d
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 28 05:11:57 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> 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'
reply other threads:[~2016-04-28 5:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1461820317.1521249252e81eb4eff9c37f498b51c52199592d.dolsen@gentoo \
--to=dolsen@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox