public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
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: Thu,  9 Jun 2011 14:24:42 +0000 (UTC)	[thread overview]
Message-ID: <1faa9bddc2859c73ce8984b43eca816c30bdb5f1.zmedico@gentoo> (raw)

commit:     1faa9bddc2859c73ce8984b43eca816c30bdb5f1
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Thu Jun  9 14:23:28 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun  9 14:23:28 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1faa9bdd

use_reduce: disallow empty parens

This will fix bug #370565.

---
 pym/portage/dep/__init__.py              |    3 +++
 pym/portage/tests/dep/test_use_reduce.py |    6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 8621543..ba37324 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -369,6 +369,9 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i
 			if need_simple_token:
 				raise InvalidDependString(
 					_("expected: file name, got: '%s', token %s") % (token, pos+1))
+			if len(mysplit) >= pos+2 and mysplit[pos+1] == ")":
+				raise InvalidDependString(
+					_("expected: dependency string, got: ')', token %s") % (pos+1,))
 			need_bracket = False
 			stack.append([])
 			level += 1

diff --git a/pym/portage/tests/dep/test_use_reduce.py b/pym/portage/tests/dep/test_use_reduce.py
index 7c7286a..b89752f 100644
--- a/pym/portage/tests/dep/test_use_reduce.py
+++ b/pym/portage/tests/dep/test_use_reduce.py
@@ -217,7 +217,7 @@ class UseReduce(TestCase):
 				uselist = ["foo", "bar"],
 				expected_result = [ "||", [ "A", "B" ] ]),
 			UseReduceTestCase(
-				"A || ( ) foo? ( ) B",
+				"A || ( bar? ( C ) ) foo? ( bar? ( C ) ) B",
 				expected_result = ["A", "B"]),
 			UseReduceTestCase(
 				"|| ( A ) || ( B )",
@@ -350,7 +350,7 @@ class UseReduce(TestCase):
 				opconvert = True,
 				expected_result = [['||', 'A', 'B']]),
 			UseReduceTestCase(
-				"A || ( ) foo? ( ) B",
+				"A || ( bar? ( C ) ) foo? ( bar? ( C ) ) B",
 				opconvert = True,
 				expected_result = ["A", "B"]),
 			UseReduceTestCase(
@@ -509,7 +509,7 @@ class UseReduce(TestCase):
 				flat = True,
 				expected_result = [ "||", "||", "A", "||", "B" ]),
 			UseReduceTestCase(
-				"A || ( ) foo? ( ) B",
+				"A || ( bar? ( C ) ) foo? ( bar? ( C ) ) B",
 				flat = True,
 				expected_result = ["A", "||", "B"]),
 			UseReduceTestCase(



             reply	other threads:[~2011-06-09 14:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09 14:24 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-02-07 22:00 Zac Medico
2011-02-05  0:16 Zac Medico
2011-02-04 22:32 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=1faa9bddc2859c73ce8984b43eca816c30bdb5f1.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