From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/ebuild/, pym/repoman/modules/scan/eclasses/, ...
Date: Tue, 3 May 2016 06:11:29 +0000 (UTC) [thread overview]
Message-ID: <1461982892.8e7971169c23a43696e020433a9f205abf98ee76.dolsen@gentoo> (raw)
Message-ID: <20160503061129.J7YYeZYWQT6lBmPt974Z12bs3eFYOdiG-2Qb-SkH2yU@z> (raw)
commit: 8e7971169c23a43696e020433a9f205abf98ee76
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 30 02:21:32 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Apr 30 02:21:32 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=8e797116
repoman: Fix logic error causing the live eclass checks to run for a non-live ebuild
The logic inverting the original live eclass checks was not working.
Restore the live_ebuild variable instead of the is_live().
Restore the original if logic and split off the actual code to another function called like the
original code did.
pym/repoman/modules/scan/ebuild/ebuild.py | 10 ++--------
pym/repoman/modules/scan/eclasses/live.py | 8 +++++---
pym/repoman/modules/scan/keywords/keywords.py | 2 +-
pym/repoman/modules/scan/metadata/ebuild_metadata.py | 2 +-
4 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/pym/repoman/modules/scan/ebuild/ebuild.py b/pym/repoman/modules/scan/ebuild/ebuild.py
index 0277aa9..7b31fcd 100644
--- a/pym/repoman/modules/scan/ebuild/ebuild.py
+++ b/pym/repoman/modules/scan/ebuild/ebuild.py
@@ -45,6 +45,7 @@ class Ebuild(ScanBase):
self.metadata = None
self.eapi = None
self.inherited = None
+ self.live_ebuild = None
self.keywords = None
self.pkgs = {}
@@ -109,6 +110,7 @@ class Ebuild(ScanBase):
self.metadata = self.pkg._metadata
self.eapi = self.metadata["EAPI"]
self.inherited = self.pkg.inherited
+ self.live_ebuild = LIVE_ECLASSES.intersection(self.inherited)
self.keywords = self.metadata["KEYWORDS"].split()
self.archs = set(kw.lstrip("~") for kw in self.keywords if not kw.startswith("-"))
return False
@@ -221,14 +223,6 @@ 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/live.py b/pym/repoman/modules/scan/eclasses/live.py
index 1ce33c0..0036f10 100644
--- a/pym/repoman/modules/scan/eclasses/live.py
+++ b/pym/repoman/modules/scan/eclasses/live.py
@@ -34,15 +34,17 @@ class LiveEclassChecks(ScanBase):
y_ebuild = kwargs.get('y_ebuild')
keywords = ebuild.keywords
- if not ebuild.is_live and self.repo_settings.repo_config.name == "gentoo":
- return False
+ if ebuild.live_ebuild and self.repo_settings.repo_config.name == "gentoo":
+ return self.check_live(pkg, package, ebuild, y_ebuild)
+ return False
+ def check_live(pkg, package, ebuild, y_ebuild):
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 " % (
+ "LIVEVCS.stable", "%s/%s.ebuild with stable keywords :%s" % (
package, y_ebuild, bad_stable_keywords))
good_keywords_exist = len(bad_stable_keywords) < len(keywords)
diff --git a/pym/repoman/modules/scan/keywords/keywords.py b/pym/repoman/modules/scan/keywords/keywords.py
index c3c8058..7cb2fe9 100644
--- a/pym/repoman/modules/scan/keywords/keywords.py
+++ b/pym/repoman/modules/scan/keywords/keywords.py
@@ -79,7 +79,7 @@ class KeywordChecks(ScanBase):
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 ebuild.is_live:
+ elif ebuild_archs and "*" not in ebuild_archs and not ebuild.live_ebuild:
dropped_keywords = previous_keywords.difference(ebuild_archs)
if dropped_keywords:
self.qatracker.add_error(
diff --git a/pym/repoman/modules/scan/metadata/ebuild_metadata.py b/pym/repoman/modules/scan/metadata/ebuild_metadata.py
index bbccedf..e991a30 100644
--- a/pym/repoman/modules/scan/metadata/ebuild_metadata.py
+++ b/pym/repoman/modules/scan/metadata/ebuild_metadata.py
@@ -40,7 +40,7 @@ class EbuildMetadata(ScanBase):
if kwargs.get('catdir') == "virtual" and \
missing_var in ("HOMEPAGE", "LICENSE"):
continue
- if ebuild.is_live and missing_var == "KEYWORDS":
+ if ebuild.live_ebuild and missing_var == "KEYWORDS":
continue
myqakey = missingvars[pos] + ".missing"
self.qatracker.add_error(myqakey, '%s/%s.ebuild'
next reply other threads:[~2016-05-03 6:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-30 2:24 Brian Dolbec [this message]
2016-05-03 6:11 ` [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/ebuild/, pym/repoman/modules/scan/eclasses/, Brian Dolbec
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=1461982892.8e7971169c23a43696e020433a9f205abf98ee76.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