* [gentoo-commits] proj/portage:master commit in: pym/repoman/checks/ebuilds/, pym/repoman/
@ 2015-09-21 23:51 Brian Dolbec
0 siblings, 0 replies; 2+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
To: gentoo-commits
commit: 1850a6ebe46abcee14fbf6d28901b186150c2a18
Author: Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 4 14:17:49 2014 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:44 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1850a6eb
repoman/main.py: More KEYWORDS checks to checks/ebuilds/keywords.py
pym/repoman/checks/ebuilds/keywords.py | 64 ++++++++++++++++++++++++++++++----
pym/repoman/main.py | 32 +----------------
2 files changed, 59 insertions(+), 37 deletions(-)
diff --git a/pym/repoman/checks/ebuilds/keywords.py b/pym/repoman/checks/ebuilds/keywords.py
index b724269..235c751 100644
--- a/pym/repoman/checks/ebuilds/keywords.py
+++ b/pym/repoman/checks/ebuilds/keywords.py
@@ -21,7 +21,7 @@ class KeywordChecks(object):
def check(
self, pkg, package, ebuild, y_ebuild, keywords, ebuild_archs, changed,
- live_ebuild):
+ live_ebuild, kwlist, profiles):
'''Perform the check.
@param pkg: Package in which we check (object).
@@ -33,21 +33,32 @@ class KeywordChecks(object):
@param changed: Changes instance
@param slot_keywords: A dictionary of keywords per slot.
@param live_ebuild: A boolean that determines if this is a live ebuild.
+ @param kwlist: A list of all global keywords.
+ @param profiles: A list of all profiles.
'''
if not self.options.straight_to_stable:
self._checkAddedWithStableKeywords(
package, ebuild, y_ebuild, keywords, changed)
+
self._checkForDroppedKeywords(
pkg, ebuild, ebuild_archs, live_ebuild)
+ self._checkForInvalidKeywords(
+ pkg, package, y_ebuild, kwlist, profiles)
+
+ self._checkForMaskLikeKeywords(
+ package, y_ebuild, keywords, kwlist)
+
self.slot_keywords[pkg.slot].update(ebuild_archs)
+ def _isKeywordStable(self, keyword):
+ return not keyword.startswith("~") and not keyword.startswith("-")
+
def _checkAddedWithStableKeywords(
self, package, ebuild, y_ebuild, keywords, changed):
catdir, pkgdir = package.split("/")
- is_stable = lambda kw: not kw.startswith("~") and not kw.startswith("-")
- stable_keywords = list(filter(is_stable, keywords))
+ stable_keywords = list(filter(self._isKeywordStable, keywords))
if stable_keywords:
if ebuild.ebuild_path in changed.new_ebuilds and catdir != "virtual":
stable_keywords.sort()
@@ -64,6 +75,47 @@ class KeywordChecks(object):
elif ebuild_archs and "*" not in ebuild_archs and not live_ebuild:
dropped_keywords = previous_keywords.difference(ebuild_archs)
if dropped_keywords:
- self.qatracker.add_error("KEYWORDS.dropped",
- "%s: %s" %
- (ebuild.relative_path, " ".join(sorted(dropped_keywords))))
+ self.qatracker.add_error(
+ "KEYWORDS.dropped", "%s: %s" % (
+ ebuild.relative_path,
+ " ".join(sorted(dropped_keywords))))
+
+ def _checkForInvalidKeywords(
+ self, pkg, package, y_ebuild, kwlist, profiles):
+ myuse = pkg._metadata["KEYWORDS"].split()
+
+ for mykey in myuse:
+ if mykey not in ("-*", "*", "~*"):
+ myskey = mykey
+
+ if not self._isKeywordStable(myskey[:1]):
+ myskey = myskey[1:]
+
+ if myskey not in kwlist:
+ self.qatracker.add_error(
+ "KEYWORDS.invalid",
+ "%s/%s.ebuild: %s" % (
+ package, y_ebuild, mykey))
+ elif myskey not in profiles:
+ self.qatracker.add_error(
+ "KEYWORDS.invalid",
+ "%s/%s.ebuild: %s (profile invalid)" % (
+ package, y_ebuild, mykey))
+
+ def _checkForMaskLikeKeywords(
+ self, package, y_ebuild, keywords, kwlist):
+
+ # KEYWORDS="-*" is a stupid replacement for package.mask
+ # and screws general KEYWORDS semantics
+ if "-*" in keywords:
+ haskeyword = False
+
+ for kw in keywords:
+ if kw[0] == "~":
+ kw = kw[1:]
+ if kw in kwlist:
+ haskeyword = True
+
+ if not haskeyword:
+ self.qatracker.add_error(
+ "KEYWORDS.stupid", package + "/" + y_ebuild + ".ebuild")
diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 4ded687..ea54ec4 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -445,22 +445,9 @@ for xpkg in effective_scanlist:
#######################
keywordcheck.check(
pkg, xpkg, ebuild, y_ebuild, keywords, ebuild_archs, changed,
- live_ebuild)
+ live_ebuild, kwlist, profiles)
#######################
- # KEYWORDS="-*" is a stupid replacement for package.mask
- # and screws general KEYWORDS semantics
- if "-*" in keywords:
- haskeyword = False
- for kw in keywords:
- if kw[0] == "~":
- kw = kw[1:]
- if kw in kwlist:
- haskeyword = True
- if not haskeyword:
- qatracker.add_error("KEYWORDS.stupid",
- xpkg + "/" + y_ebuild + ".ebuild")
-
if live_ebuild and repo_settings.repo_config.name == "gentoo":
#######################
liveeclasscheck.check(
@@ -637,23 +624,6 @@ for xpkg in effective_scanlist:
qatracker.add_error("LICENSE.deprecated",
"%s: %s" % (ebuild.relative_path, lic))
- # keyword checks
- myuse = myaux["KEYWORDS"].split()
- for mykey in myuse:
- if mykey not in ("-*", "*", "~*"):
- myskey = mykey
- if myskey[:1] == "-":
- myskey = myskey[1:]
- if myskey[:1] == "~":
- myskey = myskey[1:]
- if myskey not in kwlist:
- qatracker.add_error("KEYWORDS.invalid",
- "%s/%s.ebuild: %s" % (xpkg, y_ebuild, mykey))
- elif myskey not in profiles:
- qatracker.add_error("KEYWORDS.invalid",
- "%s/%s.ebuild: %s (profile invalid)"
- % (xpkg, y_ebuild, mykey))
-
# restrict checks
myrestrict = None
try:
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/checks/ebuilds/, pym/repoman/
@ 2015-09-24 15:24 Brian Dolbec
0 siblings, 0 replies; 2+ messages in thread
From: Brian Dolbec @ 2015-09-24 15:24 UTC (permalink / raw
To: gentoo-commits
commit: 5ebf2c4b0aa6b1e08f36c9dd56fcab152d54d785
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 24 15:22:04 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Sep 24 15:23:11 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=5ebf2c4b
repoman: Remve the redundant repoman_settings initialaztion parameter
repoman_settings is available as part of repo_settings.
Use the repo_settings instance directly.
pym/repoman/checks/ebuilds/fetches.py | 4 ++--
pym/repoman/scanner.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/pym/repoman/checks/ebuilds/fetches.py b/pym/repoman/checks/ebuilds/fetches.py
index 0b9c321..077340d 100644
--- a/pym/repoman/checks/ebuilds/fetches.py
+++ b/pym/repoman/checks/ebuilds/fetches.py
@@ -17,7 +17,7 @@ class FetchChecks(object):
'''Performs checks on the files needed for the ebuild'''
def __init__(
- self, qatracker, repoman_settings, repo_settings, portdb, vcs_settings):
+ self, qatracker, repo_settings, portdb, vcs_settings):
'''
@param qatracker: QATracker instance
@param repoman_settings: settings instance
@@ -27,7 +27,7 @@ class FetchChecks(object):
self.portdb = portdb
self.qatracker = qatracker
self.repo_settings = repo_settings
- self.repoman_settings = repoman_settings
+ self.repoman_settings = repo_settings.repoman_settings
self.vcs_settings = vcs_settings
def check(self, xpkg, checkdir, checkdir_relative, mychanged, mynew):
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index ace878a..1e1a38e 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -199,7 +199,7 @@ class Scanner(object):
self.qatracker, self.repo_settings.repoman_settings, self.repo_settings, self.portdb, self.vcs_settings)
self.status_check = VCSStatus(self.vcs_settings, self.qatracker)
self.fetchcheck = FetchChecks(
- self.qatracker, self.repo_settings.repoman_settings, self.repo_settings, self.portdb, self.vcs_settings)
+ self.qatracker, self.repo_settings, self.portdb, self.vcs_settings)
self.pkgmeta = PkgMetadata(self.options, self.qatracker, self.repo_settings.repoman_settings)
self.thirdparty = ThirdPartyMirrors(self.repo_settings.repoman_settings, self.qatracker)
self.use_flag_checks = USEFlagChecks(self.qatracker, uselist)
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-24 15:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-24 15:24 [gentoo-commits] proj/portage:master commit in: pym/repoman/checks/ebuilds/, pym/repoman/ Brian Dolbec
-- strict thread matches above, loose matches on Subject: below --
2015-09-21 23:51 Brian Dolbec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox