From: Sebastian Luther Date: Wed, 18 Aug 2010 13:50:53 +0000 (+0200) Subject: check_required_use: Fix the same bug as in use_reduce X-Git-Tag: v2.2_rc68~105 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=14c7b1773dea0961a6c718dc72ab3cf20c9554a9;p=portage.git check_required_use: Fix the same bug as in use_reduce --- diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index 5b0473389..8bbcd3e59 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -1735,7 +1735,7 @@ def check_required_use(required_use, use, iuse_match): ignore = True if l and not ignore: - stack[level].extend(l) + stack[level].append(all(x for x in l)) else: raise portage.exception.InvalidDependString( _("malformed syntax: '%s'") % required_use) diff --git a/pym/portage/tests/dep/testCheckRequiredUse.py b/pym/portage/tests/dep/testCheckRequiredUse.py index 9468ca394..4b67d6250 100644 --- a/pym/portage/tests/dep/testCheckRequiredUse.py +++ b/pym/portage/tests/dep/testCheckRequiredUse.py @@ -73,6 +73,24 @@ class TestCheckRequiredUse(TestCase): ( "^^ ( || ( a b ) ^^ ( b c ) )", ["a", "c"], ["a", "b", "c"], False), ( "^^ ( || ( a b ) ^^ ( b c ) )", ["b", "c"], ["a", "b", "c"], True), ( "^^ ( || ( a b ) ^^ ( b c ) )", ["a", "b", "c"], ["a", "b", "c"], True), + + ( "|| ( ( a b ) c )", ["a", "b", "c"], ["a", "b", "c"], True), + ( "|| ( ( a b ) c )", ["b", "c"], ["a", "b", "c"], True), + ( "|| ( ( a b ) c )", ["a", "c"], ["a", "b", "c"], True), + ( "|| ( ( a b ) c )", ["a", "b"], ["a", "b", "c"], True), + ( "|| ( ( a b ) c )", ["a"], ["a", "b", "c"], False), + ( "|| ( ( a b ) c )", ["b"], ["a", "b", "c"], False), + ( "|| ( ( a b ) c )", ["c"], ["a", "b", "c"], True), + ( "|| ( ( a b ) c )", [], ["a", "b", "c"], False), + + ( "^^ ( ( a b ) c )", ["a", "b", "c"], ["a", "b", "c"], False), + ( "^^ ( ( a b ) c )", ["b", "c"], ["a", "b", "c"], True), + ( "^^ ( ( a b ) c )", ["a", "c"], ["a", "b", "c"], True), + ( "^^ ( ( a b ) c )", ["a", "b"], ["a", "b", "c"], True), + ( "^^ ( ( a b ) c )", ["a"], ["a", "b", "c"], False), + ( "^^ ( ( a b ) c )", ["b"], ["a", "b", "c"], False), + ( "^^ ( ( a b ) c )", ["c"], ["a", "b", "c"], True), + ( "^^ ( ( a b ) c )", [], ["a", "b", "c"], False), ) test_cases_xfail = (