From: "Brian Dolbec" <brian.dolbec@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/checks/ebuilds/
Date: Wed, 1 Oct 2014 23:46:36 +0000 (UTC) [thread overview]
Message-ID: <1412207134.c4c004b5125e1785af163d3d574a3f61ccadd062.dol-sen@gentoo> (raw)
commit: c4c004b5125e1785af163d3d574a3f61ccadd062
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 3 19:39:56 2014 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Wed Oct 1 23:45:34 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c4c004b5
repoman.../use_flags.py: Reset state variables for each check() run
Also double space function separations.
---
pym/repoman/checks/ebuilds/use_flags.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/pym/repoman/checks/ebuilds/use_flags.py b/pym/repoman/checks/ebuilds/use_flags.py
index bc09ed7..d63ae6d 100644
--- a/pym/repoman/checks/ebuilds/use_flags.py
+++ b/pym/repoman/checks/ebuilds/use_flags.py
@@ -19,10 +19,11 @@ class USEFlagChecks(object):
@param globalUseFlags: Global USE flags
'''
self.qatracker = qatracker
+ self.globalUseFlags = globalUseFlags
self.useFlags = []
self.defaultUseFlags = []
self.usedUseFlags = set()
- self.globalUseFlags = globalUseFlags
+
def check(self, pkg, package, ebuild, y_ebuild, localUseFlags):
'''Perform the check.
@@ -33,14 +34,20 @@ class USEFlagChecks(object):
@param y_ebuild: Ebuild which we check (string).
@param localUseFlags: Local USE flags of the package
'''
+ # reset state variables for the run
+ self.useFlags = []
+ self.defaultUseFlags = []
+ self.usedUseFlags = set()
self._checkGlobal(pkg)
self._checkMetadata(package, ebuild, y_ebuild, localUseFlags)
self._checkRequiredUSE(pkg, ebuild)
+
def getUsedUseFlags(self):
'''Get the USE flags that this check has seen'''
return self.usedUseFlags
+
def _checkGlobal(self, pkg):
for myflag in pkg._metadata["IUSE"].split():
flag_name = myflag.lstrip("+-")
@@ -50,6 +57,7 @@ class USEFlagChecks(object):
if flag_name not in self.globalUseFlags:
self.useFlags.append(flag_name)
+
def _checkMetadata(self, package, ebuild, y_ebuild, localUseFlags):
for mypos in range(len(self.useFlags) - 1, -1, -1):
if self.useFlags[mypos] and (self.useFlags[mypos] in localUseFlags):
@@ -67,6 +75,7 @@ class USEFlagChecks(object):
"IUSE.invalid",
"%s/%s.ebuild: %s" % (package, y_ebuild, self.useFlags[mypos]))
+
def _checkRequiredUSE(self, pkg, ebuild):
required_use = pkg._metadata["REQUIRED_USE"]
if required_use:
next reply other threads:[~2014-10-01 23:46 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-01 23:46 Brian Dolbec [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-01-20 23:53 [gentoo-commits] proj/portage:repoman commit in: pym/repoman/checks/ebuilds/ Zac Medico
2015-09-17 4:51 Brian Dolbec
2015-09-17 3:08 Brian Dolbec
2015-09-05 21:48 Brian Dolbec
2015-09-05 21:48 Brian Dolbec
2015-09-05 21:27 Brian Dolbec
2015-09-05 21:27 Brian Dolbec
2015-08-11 23:54 Brian Dolbec
2015-08-11 23:54 Brian Dolbec
2015-08-10 14:45 Michał Górny
2015-08-10 14:45 Michał Górny
2015-08-10 13:44 Brian Dolbec
2015-08-10 13:44 Brian Dolbec
2014-11-17 0:55 Brian Dolbec
2014-11-17 0:55 Brian Dolbec
2014-10-01 23:46 Brian Dolbec
2014-10-01 23:02 Brian Dolbec
2014-10-01 23:02 Brian Dolbec
2014-06-03 19:40 Brian Dolbec
2014-06-02 16:24 Tom Wijsman
2014-06-02 15:44 Brian Dolbec
2014-06-02 14:24 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=1412207134.c4c004b5125e1785af163d3d574a3f61ccadd062.dol-sen@gentoo \
--to=brian.dolbec@gmail.com \
--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