diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-09-20 16:55:27 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-09-20 16:55:27 +0000 |
commit | 487802e2ce713ffda70f2911670772dad9c5e7d8 (patch) | |
tree | 7528aac627f23d3cbbd0bd41ba870e074de56dfb | |
parent | 8d1fdc19743d65f0e03dbfc3d1f5728b308f619a (diff) | |
download | portage-487802e2ce713ffda70f2911670772dad9c5e7d8.tar.gz portage-487802e2ce713ffda70f2911670772dad9c5e7d8.tar.bz2 portage-487802e2ce713ffda70f2911670772dad9c5e7d8.zip |
More SRC_URI validation.
svn path=/main/trunk/; revision=11526
-rw-r--r-- | pym/portage/dbapi/porttree.py | 4 | ||||
-rw-r--r-- | pym/portage/tests/dep/test_src_uri.py | 3 |
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 ), |