From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1PlWV7-0004tS-H3 for garchives@archives.gentoo.org; Sat, 05 Feb 2011 00:59:45 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CC936E00D3; Sat, 5 Feb 2011 00:59:38 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 860C7E00D3 for ; Sat, 5 Feb 2011 00:59:38 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1E32A1B4120 for ; Sat, 5 Feb 2011 00:59:38 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 7CAE78006A for ; Sat, 5 Feb 2011 00:59:37 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <5dc4bb046b871088923313bce4b66bde3c8e2e80.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/dep/, pym/portage/tests/dep/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/dep/__init__.py pym/portage/tests/dep/testCheckRequiredUse.py X-VCS-Directories: pym/portage/dep/ pym/portage/tests/dep/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 5dc4bb046b871088923313bce4b66bde3c8e2e80 Date: Sat, 5 Feb 2011 00:59:37 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 10cb81f565b416d4dfea2300e3b40281 commit: 5dc4bb046b871088923313bce4b66bde3c8e2e80 Author: Zac Medico gentoo org> AuthorDate: Fri Feb 4 22:31:32 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Sat Feb 5 00:30:54 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D5dc4bb04 check_required_use: clarify operator logic --- pym/portage/dep/__init__.py | 15 +++++++-------- pym/portage/tests/dep/testCheckRequiredUse.py | 5 +++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index b27d589..b429e56 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -2187,10 +2187,9 @@ def check_required_use(required_use, use, iuse_mat= ch): if level > 0: level -=3D 1 l =3D stack.pop() - ignore =3D False + op =3D None if stack[level]: if stack[level][-1] in ("||", "^^"): - ignore =3D True op =3D stack[level].pop() satisfied =3D is_satisfied(op, l) stack[level].append(satisfied) @@ -2198,13 +2197,12 @@ def check_required_use(required_use, use, iuse_ma= tch): =20 elif not isinstance(stack[level][-1], bool) and \ stack[level][-1][-1] =3D=3D "?": - if is_active(stack[level][-1][:-1]): - op =3D stack[level].pop() + op =3D stack[level].pop() + if is_active(op[:-1]): satisfied =3D is_satisfied(op, l) stack[level].append(satisfied) node._satisfied =3D satisfied else: - stack[level].pop() node._satisfied =3D True last_node =3D node._parent._children.pop() if last_node is not node: @@ -2212,12 +2210,13 @@ def check_required_use(required_use, use, iuse_ma= tch): "node is not last child of parent") node =3D node._parent continue - ignore =3D True =20 - if l and not ignore: + if op is None: satisfied =3D False not in l - stack[level].append(satisfied) node._satisfied =3D satisfied + if l: + stack[level].append(satisfied) + if node._parent._operator not in ("||", "^^"): last_node =3D node._parent._children.pop() if last_node is not node: diff --git a/pym/portage/tests/dep/testCheckRequiredUse.py b/pym/portage/= tests/dep/testCheckRequiredUse.py index c5a8f53..a0e10b1 100644 --- a/pym/portage/tests/dep/testCheckRequiredUse.py +++ b/pym/portage/tests/dep/testCheckRequiredUse.py @@ -195,6 +195,11 @@ class TestCheckRequiredUse(TestCase): "|| ( ( ( ( a ) ) ( ( ( b c ) ) ) ) )", [""], "a b c" + ), + ( + "|| ( ( a ( ( ) ( ) ) ( ( ) ) ( b ( ) c ) ) )", + [""], + "a b c" ) ) for required_use, use, expected in test_cases: