1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-17 10:40:12 +02:00

Don't try and parse username/password out of repo address except for svn

This commit is contained in:
Ciaran Gultnieks 2013-10-02 10:25:26 +01:00
parent 381bbb60ac
commit 8f8360fcf6

View File

@ -53,19 +53,18 @@ class vcs:
self.sdk_path = sdk_path self.sdk_path = sdk_path
# It's possible to sneak a username and password in with # It's possible to sneak a username and password in with
# the remote address... (this really only applies to svn # the remote address for svn...
# and we should probably be more specific!) self.username = None
index = remote.find('@') if self.repotype() == 'svn':
if index != -1: index = remote.find('@')
self.username = remote[:index] if index != -1:
remote = remote[index+1:] self.username = remote[:index]
index = self.username.find(':') remote = remote[index+1:]
if index == -1: index = self.username.find(':')
raise VCSException("Password required with username") if index == -1:
self.password = self.username[index+1:] raise VCSException("Password required with username")
self.username = self.username[:index] self.password = self.username[index+1:]
else: self.username = self.username[:index]
self.username = None
self.remote = remote self.remote = remote
self.local = local self.local = local