More SRC_URI validation.
authorZac Medico <zmedico@gentoo.org>
Sat, 20 Sep 2008 16:55:27 +0000 (16:55 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 20 Sep 2008 16:55:27 +0000 (16:55 -0000)
svn path=/main/trunk/; revision=11526

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

index 67e7955d4df24b0b8dd11d97433b89a50bc9a6f6..33c8b52f293f96296c044bec55e3eb2390f0890d 100644 (file)
@@ -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
 
index 3b9f080527e5f2087058fa2fcf94e0c86aab6f5d..84c9f29b6d3f752ebde70fca5017fdf3fd016220 100644 (file)
@@ -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 ),