hotfix: add clean_repos_userinfo to hide repos useinfo
authorZhang Qiang <qiang.z.zhang@intel.com>
Tue, 14 Aug 2012 12:50:17 +0000 (20:50 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Tue, 14 Aug 2012 12:50:17 +0000 (20:50 +0800)
gitbuildsys/cmd_build.py

index cac8960..1024ba5 100644 (file)
@@ -239,6 +239,22 @@ def get_repos_conf():
 
     return result
 
+def clean_repos_userinfo(repos):
+    striped_repos = []
+    for repo in repos:
+        splitted = urlsplit(repo)
+        if not splitted.username:
+            striped_repos.append(repo)
+        else:
+            splitted_list = list(splitted)
+            if splitted.port:
+                splitted_list[1] = '%s:%d' % (splitted.hostname, splitted.port)
+            else:
+                splitted_list[1] = splitted.hostname
+            striped_repos.append(urlunsplit(splitted_list))
+
+    return striped_repos
+
 def do(opts, args):
 
     workdir = os.getcwd()
@@ -323,7 +339,7 @@ def do(opts, args):
         if not repourls:
             msger.error('no repositories found for arch: %s under the '\
                         'following repos:\n      %s' % \
-                        (buildarch, '\n'.join(repos)))
+                        (buildarch, '\n'.join(clean_repos_userinfo(repos))))
         for url in repourls:
             if not  re.match('https?://.*', url) and \
                not (url.startswith('/') and os.path.exists(url)):