summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-11 07:45:21 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-11 07:45:21 +0000
commit6eaa212cc6cfe71541a8181d8de863af9af8d6c0 (patch)
tree33654411f29022056fa2b67f8e4d0fff4b61c20b
parentFix incorrect slice inside _src_uri_validate() and add new test case. (diff)
downloadportage-multirepo-6eaa212cc6cfe71541a8181d8de863af9af8d6c0.tar.gz
portage-multirepo-6eaa212cc6cfe71541a8181d8de863af9af8d6c0.tar.bz2
portage-multirepo-6eaa212cc6cfe71541a8181d8de863af9af8d6c0.zip
Remove redundant conditional inside _src_uri_validate(). (trunk r12819)
svn path=/main/branches/2.1.6/; revision=13051
-rw-r--r--pym/portage/dbapi/porttree.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 8dcdf1b8..caff7f80 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -69,15 +69,19 @@ def _src_uri_validate(cpv, eapi, src_uri):
if operator is None:
uri = x
continue
- if operator is not None:
- if "/" in x:
- 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,))
+
+ # This should be the right operand of an arrow operator.
+ if "/" in x:
+ 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,))
+
+ # Found the right operand, so reset state.
uri = None
operator = None