From 2fc5992483026e6451106063cd64def59646ebab Mon Sep 17 00:00:00 2001 From: Huang Hao Date: Wed, 15 Aug 2012 10:28:10 +0800 Subject: [PATCH] Use hostport instead of hostname. Include port in urls returns by get_repos_conf(). Fix issue#234 --- gitbuildsys/cmd_build.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gitbuildsys/cmd_build.py b/gitbuildsys/cmd_build.py index 2c6a9ec..959750b 100644 --- a/gitbuildsys/cmd_build.py +++ b/gitbuildsys/cmd_build.py @@ -223,14 +223,19 @@ def get_repos_conf(): user = item.get('user') or splitted.username passwd = item.get('passwd') or splitted.password + if splitted.port: + hostport = '%s:%d' % (splitted.hostname, splitted.port) + else: + hostport = splitted.hostname + splitted_list = list(splitted) if user: if passwd: splitted_list[1] = '%s:%s@%s' % (urllib2.quote(user, safe=''), - passwd, splitted.hostname) + passwd, hostport) else: splitted_list[1] = '%s@%s' % (urllib2.quote(user, safe=''), - splitted.hostname) + hostport) elif passwd: raise errors.ConfigError('No user is specified for %s, '\ 'only password' % key) -- 2.7.4