From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id B32B51384C3 for ; Sat, 5 Sep 2015 21:48:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CDD851430F; Sat, 5 Sep 2015 21:48:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B7DD1142A0 for ; Sat, 5 Sep 2015 21:48:11 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0EE30340A02 for ; Sat, 5 Sep 2015 21:48:11 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 15C79194 for ; Sat, 5 Sep 2015 21:48:08 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1441489656.f8dc20495c0d634eedfd15d3ddc9f9e25d69d42e.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/checks/ebuilds/ X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/checks/ebuilds/use_flags.py X-VCS-Directories: pym/repoman/checks/ebuilds/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: f8dc20495c0d634eedfd15d3ddc9f9e25d69d42e X-VCS-Branch: repoman Date: Sat, 5 Sep 2015 21:48:08 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a774c81c-8def-495e-828e-cc58e2d4ebf6 X-Archives-Hash: 008131d0b81047dc9121569a117b11ff commit: f8dc20495c0d634eedfd15d3ddc9f9e25d69d42e Author: Brian Dolbec gentoo org> AuthorDate: Tue Jun 3 19:39:56 2014 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Sat Sep 5 21:47:36 2015 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f8dc2049 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: