summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/dbapi/porttree.py4
-rw-r--r--pym/portage/tests/dep/test_src_uri.py3
2 files changed, 7 insertions, 0 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 67e7955d4..33c8b52f2 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -68,6 +68,10 @@ def _src_uri_validate(cpv, eapi, src_uri):
raise portage.exception.InvalidDependString(
("getFetchMap(): '%s' SRC_URI '/' character in " + \
"file name: '%s'") % (cpv, x))
+ if x[-1] == "?":
+ raise portage.exception.InvalidDependString(
+ ("getFetchMap(): '%s' SRC_URI arrow missing " + \
+ "right operand") % (cpv,))
uri = None
operator = None
diff --git a/pym/portage/tests/dep/test_src_uri.py b/pym/portage/tests/dep/test_src_uri.py
index 3b9f08052..84c9f29b6 100644
--- a/pym/portage/tests/dep/test_src_uri.py
+++ b/pym/portage/tests/dep/test_src_uri.py
@@ -16,6 +16,9 @@ class SrcUri(TestCase):
( "1", "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", "http://foo/bar -> bar.tbz2 foo? ( ftp://foo/a )" , True ),
+ ( "2", "http://foo/bar blah.tbz2 ->" , False ),
( "2", "-> http://foo/bar blah.tbz2 )" , False ),
( "2", "http://foo/bar ->" , False ),
( "2", "foo? ( http://foo/bar -> ) blah.tbz2" , False ),