* [gentoo-commits] proj/portage:master commit in: pym/repoman/modules/scan/metadata/, pym/repoman/modules/scan/ebuild/, ...
@ 2016-04-30 2:24 Brian Dolbec
2016-05-03 6:11 ` [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/ebuild/, pym/repoman/modules/scan/eclasses/, Brian Dolbec
0 siblings, 1 reply; 2+ messages in thread
From: Brian Dolbec @ 2016-04-30 2:24 UTC (permalink / raw
To: gentoo-commits
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'
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/ebuild/, pym/repoman/modules/scan/eclasses/, ...
2016-04-30 2:24 [gentoo-commits] proj/portage:master commit in: pym/repoman/modules/scan/metadata/, pym/repoman/modules/scan/ebuild/, Brian Dolbec
@ 2016-05-03 6:11 ` Brian Dolbec
0 siblings, 0 replies; 2+ messages in thread
From: Brian Dolbec @ 2016-05-03 6:11 UTC (permalink / raw
To: gentoo-commits
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'
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-03 6:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-30 2:24 [gentoo-commits] proj/portage:master commit in: pym/repoman/modules/scan/metadata/, pym/repoman/modules/scan/ebuild/, Brian Dolbec
2016-05-03 6:11 ` [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/ebuild/, pym/repoman/modules/scan/eclasses/, Brian Dolbec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox