|
@@ -26,6 +26,7 @@ import optparse
|
|
|
import os
|
|
import os
|
|
|
import re
|
|
import re
|
|
|
import sys
|
|
import sys
|
|
|
|
|
+import urllib2
|
|
|
|
|
|
|
|
from trace import SetTrace
|
|
from trace import SetTrace
|
|
|
from git_config import init_ssh, close_ssh
|
|
from git_config import init_ssh, close_ssh
|
|
@@ -199,6 +200,12 @@ def _PruneOptions(argv, opt):
|
|
|
continue
|
|
continue
|
|
|
i += 1
|
|
i += 1
|
|
|
|
|
|
|
|
|
|
+def init_http():
|
|
|
|
|
+ if 'http_proxy' in os.environ:
|
|
|
|
|
+ url = os.environ['http_proxy']
|
|
|
|
|
+ proxy_support = urllib2.ProxyHandler({'http': url, 'https': url})
|
|
|
|
|
+ urllib2.install_opener(urllib2.build_opener(proxy_support))
|
|
|
|
|
+
|
|
|
def _Main(argv):
|
|
def _Main(argv):
|
|
|
opt = optparse.OptionParser(usage="repo wrapperinfo -- ...")
|
|
opt = optparse.OptionParser(usage="repo wrapperinfo -- ...")
|
|
|
opt.add_option("--repo-dir", dest="repodir",
|
|
opt.add_option("--repo-dir", dest="repodir",
|
|
@@ -217,6 +224,7 @@ def _Main(argv):
|
|
|
try:
|
|
try:
|
|
|
try:
|
|
try:
|
|
|
init_ssh()
|
|
init_ssh()
|
|
|
|
|
+ init_http()
|
|
|
repo._Run(argv)
|
|
repo._Run(argv)
|
|
|
finally:
|
|
finally:
|
|
|
close_ssh()
|
|
close_ssh()
|