From: Zhang Qiang Date: Tue, 14 Aug 2012 12:50:17 +0000 (+0800) Subject: hotfix: add clean_repos_userinfo to hide repos useinfo X-Git-Tag: 0.9~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50cc140c3bf9bd75ad313d2db4d9b2785c5b376d;p=tools%2Fgbs.git hotfix: add clean_repos_userinfo to hide repos useinfo --- diff --git a/gitbuildsys/cmd_build.py b/gitbuildsys/cmd_build.py index cac8960..1024ba5 100644 --- a/gitbuildsys/cmd_build.py +++ b/gitbuildsys/cmd_build.py @@ -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)):