From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dep/, pym/portage/tests/dep/
Date: Fri, 4 Feb 2011 22:32:40 +0000 (UTC) [thread overview]
Message-ID: <9ba0d885cddeb7de649e09a2c9276f25c4190b5e.zmedico@gentoo> (raw)
commit: 9ba0d885cddeb7de649e09a2c9276f25c4190b5e
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 4 22:31:32 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb 4 22:31:32 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9ba0d885
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_match):
if level > 0:
level -= 1
l = stack.pop()
- ignore = False
+ op = None
if stack[level]:
if stack[level][-1] in ("||", "^^"):
- ignore = True
op = stack[level].pop()
satisfied = is_satisfied(op, l)
stack[level].append(satisfied)
@@ -2198,13 +2197,12 @@ def check_required_use(required_use, use, iuse_match):
elif not isinstance(stack[level][-1], bool) and \
stack[level][-1][-1] == "?":
- if is_active(stack[level][-1][:-1]):
- op = stack[level].pop()
+ op = stack[level].pop()
+ if is_active(op[:-1]):
satisfied = is_satisfied(op, l)
stack[level].append(satisfied)
node._satisfied = satisfied
else:
- stack[level].pop()
node._satisfied = True
last_node = node._parent._children.pop()
if last_node is not node:
@@ -2212,12 +2210,13 @@ def check_required_use(required_use, use, iuse_match):
"node is not last child of parent")
node = node._parent
continue
- ignore = True
- if l and not ignore:
+ if op is None:
satisfied = False not in l
- stack[level].append(satisfied)
node._satisfied = satisfied
+ if l:
+ stack[level].append(satisfied)
+
if node._parent._operator not in ("||", "^^"):
last_node = 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:
next reply other threads:[~2011-02-04 22:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-04 22:32 Zac Medico [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-09-21 20:15 [gentoo-commits] proj/portage:master commit in: pym/portage/dep/, pym/portage/tests/dep/ Zac Medico
2013-06-09 0:23 Zac Medico
2013-05-24 18:02 Zac Medico
2013-01-04 4:35 Zac Medico
2012-09-18 20:17 Zac Medico
2012-07-18 21:07 Zac Medico
2012-05-13 20:11 Zac Medico
2011-10-04 4:45 Zac Medico
2011-06-09 18:48 Zac Medico
2011-06-09 14:24 Zac Medico
2011-02-07 22:00 Zac Medico
2011-02-05 0:16 Zac Medico
2011-02-04 21:07 zmedico
2011-02-04 5:42 zmedico
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=9ba0d885cddeb7de649e09a2c9276f25c4190b5e.zmedico@gentoo \
--to=zmedico@gentoo.org \
--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