summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-10 05:24:08 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-10 05:24:08 +0000
commit8ebc64df649d8eee10185ec5c7cf54428ee1d9ba (patch)
tree866644a56fdfde0d310c7ce6d0e5cad83d7a0b45
parente40282011279ed59bc87c7ee3d1811a0cfcf19e2 (diff)
downloadportage-8ebc64df649d8eee10185ec5c7cf54428ee1d9ba.tar.gz
portage-8ebc64df649d8eee10185ec5c7cf54428ee1d9ba.tar.bz2
portage-8ebc64df649d8eee10185ec5c7cf54428ee1d9ba.zip
Make _src_uri_validate() identify the || operator as invalid and add a
corresponding test case. svn path=/main/trunk/; revision=12820
-rw-r--r--pym/portage/dbapi/porttree.py5
-rw-r--r--pym/portage/tests/dep/test_src_uri.py1
2 files changed, 6 insertions, 0 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index caff7f80f..93730e9c3 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -45,6 +45,11 @@ def _src_uri_validate(cpv, eapi, src_uri):
uri = None
_src_uri_validate(cpv, eapi, x)
continue
+ if x == '||':
+ raise portage.exception.InvalidDependString(
+ ("getFetchMap(): '%s' SRC_URI contains invalid " + \
+ "|| operator") % (cpv,))
+
if x[-1:] == "?":
if operator is not None:
raise portage.exception.InvalidDependString(
diff --git a/pym/portage/tests/dep/test_src_uri.py b/pym/portage/tests/dep/test_src_uri.py
index 499d1e295..9955ca096 100644
--- a/pym/portage/tests/dep/test_src_uri.py
+++ b/pym/portage/tests/dep/test_src_uri.py
@@ -14,6 +14,7 @@ class SrcUri(TestCase):
tests = [
( "0", "http://foo/bar -> blah.tbz2" , False ),
( "1", "http://foo/bar -> blah.tbz2" , False ),
+ ( "2", "|| ( http://foo/bar -> blah.tbz2 )" , False ),
( "2", "http://foo/bar -> blah.tbz2" , True ),
( "2", "foo? ( http://foo/bar -> blah.tbz2 )" , True ),
( "2", "http://foo/bar -> foo? ( ftp://foo/a )" , False ),