From 64475c22351be7730fa76091c89cf343000012b3 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 11 Mar 2009 07:45:33 +0000 Subject: [PATCH] Make _src_uri_validate() identify the || operator as invalid and add a corresponding test case. (trunk r12820) svn path=/main/branches/2.1.6/; revision=13052 --- pym/portage/dbapi/porttree.py | 5 +++++ pym/portage/tests/dep/test_src_uri.py | 1 + 2 files changed, 6 insertions(+) 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 ), -- 2.26.2