Make _src_uri_validate() identify the || operator as invalid and add a
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 07:45:33 +0000 (07:45 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 07:45:33 +0000 (07:45 -0000)
corresponding test case. (trunk r12820)

svn path=/main/branches/2.1.6/; revision=13052

pym/portage/dbapi/porttree.py
pym/portage/tests/dep/test_src_uri.py

index caff7f80f5b5d44ce6d879b72d84385930ae949d..93730e9c333a4d6f98b008f7be2294566cdf7df2 100644 (file)
@@ -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(
index 499d1e295bfd063d6113b6cb8047b02924badba8..9955ca09613da0c9002ccc305eb837e59b7994a9 100644 (file)
@@ -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 ),