From 3698ab7c9200a2b65652e9a5f3a763cd7629af0c Mon Sep 17 00:00:00 2001 From: Xin Li Date: Tue, 25 Jun 2019 16:09:43 -0700 Subject: [PATCH] Support clone bundle through persistent-http[s]. Bug: https://crbug.com/gerrit/11075 Change-Id: I367c6bfe8da47d886c017a2ac614d4ccb3f8a438 --- project.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/project.py b/project.py index ae2bf6f3..8a38c584 100755 --- a/project.py +++ b/project.py @@ -2217,13 +2217,17 @@ class Project(object): cmd += ['--continue-at', '%d' % (size,)] else: platform_utils.remove(tmpPath) - if 'http_proxy' in os.environ and 'darwin' == sys.platform: - cmd += ['--proxy', os.environ['http_proxy']] - with GetUrlCookieFile(srcUrl, quiet) as (cookiefile, _proxy): + with GetUrlCookieFile(srcUrl, quiet) as (cookiefile, proxy): if cookiefile: cmd += ['--cookie', cookiefile, '--cookie-jar', cookiefile] - if srcUrl.startswith('persistent-'): - srcUrl = srcUrl[len('persistent-'):] + if proxy: + cmd += ['--proxy', proxy] + elif 'http_proxy' in os.environ and 'darwin' == sys.platform: + cmd += ['--proxy', os.environ['http_proxy']] + if srcUrl.startswith('persistent-https'): + srcUrl = 'http' + srcUrl[len('persistent-https'):] + elif srcUrl.startswith('persistent-http'): + srcUrl = 'http' + srcUrl[len('persistent-http'):] cmd += [srcUrl] if IsTrace():