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 209C31381FA for ; Tue, 3 Jun 2014 19:40:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 86543E0946; Tue, 3 Jun 2014 19:40:25 +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 17799E0946 for ; Tue, 3 Jun 2014 19:40:24 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BF2F933FCDE for ; Tue, 3 Jun 2014 19:40:23 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 48B08181A9 for ; Tue, 3 Jun 2014 19:40:22 +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: <1401824396.fc3ff802cda4854498aa8b304c1102af0cef257c.dol-sen@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: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: fc3ff802cda4854498aa8b304c1102af0cef257c X-VCS-Branch: repoman Date: Tue, 3 Jun 2014 19:40:22 +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: 8c46dc2b-7a0f-4dc3-849e-a47aad7b13dd X-Archives-Hash: 54f2fb18383831c1acbb523b3aa6c1e0 commit: fc3ff802cda4854498aa8b304c1102af0cef257c Author: Brian Dolbec gentoo org> AuthorDate: Tue Jun 3 19:39:56 2014 +0000 Commit: Brian Dolbec gmail com> CommitDate: Tue Jun 3 19:39:56 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fc3ff802 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: