Use hostport instead of hostname.
authorHuang Hao <hao.h.huang@intel.com>
Wed, 15 Aug 2012 02:28:10 +0000 (10:28 +0800)
committerHuang Hao <hao.h.huang@intel.com>
Wed, 15 Aug 2012 02:33:15 +0000 (10:33 +0800)
Include port in urls returns by get_repos_conf(). Fix issue#234

gitbuildsys/cmd_build.py

index 2c6a9ec..959750b 100644 (file)
@@ -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)