Remove redundant conditional inside _src_uri_validate(). (trunk r12819)
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 07:45:21 +0000 (07:45 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 07:45:21 +0000 (07:45 -0000)
svn path=/main/branches/2.1.6/; revision=13051

pym/portage/dbapi/porttree.py

index 8dcdf1b85454a5d58ce0be54a2b4288b05906bfe..caff7f80f5b5d44ce6d879b72d84385930ae949d 100644 (file)
@@ -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