diff options
author | 2008-08-09 01:00:03 +0530 | |
---|---|---|
committer | 2008-08-09 01:00:03 +0530 | |
commit | 23c8ce789ef35726c8d064f23162ba47fe4a5d25 (patch) | |
tree | f58bafb92866014cfecdac9c68da1c377502ff9c | |
parent | - Implement post() and emerge() (diff) | |
download | autotua-23c8ce789ef35726c8d064f23162ba47fe4a5d25.tar.gz autotua-23c8ce789ef35726c8d064f23162ba47fe4a5d25.tar.bz2 autotua-23c8ce789ef35726c8d064f23162ba47fe4a5d25.zip |
Add http proxy support for git and git+ssh
git-proxy-cmd.sh uses the http_proxy variable to tunnel the git connections
-rwxr-xr-x | scripts/git-proxy-cmd.sh | 8 | ||||
-rw-r--r-- | slave/autotua/const.py | 9 |
2 files changed, 17 insertions, 0 deletions
diff --git a/scripts/git-proxy-cmd.sh b/scripts/git-proxy-cmd.sh new file mode 100755 index 0000000..c69d4ad --- /dev/null +++ b/scripts/git-proxy-cmd.sh @@ -0,0 +1,8 @@ +proxy=${http_proxy#http://} +host=${proxy##*@} +auth=${proxy%@*} +if test -n "${auth}"; then + export HTTP_PROXY_USER=${auth%%:*} + export HTTP_PROXY_PASSWORD=${auth##*:} +fi +connect -H ${host} $1 $2 diff --git a/slave/autotua/const.py b/slave/autotua/const.py index cb638fd..7728914 100644 --- a/slave/autotua/const.py +++ b/slave/autotua/const.py @@ -11,6 +11,7 @@ Internal Constants """ import os.path as osp +import os VERBOSE = True FULL_CLEAN = False @@ -23,6 +24,14 @@ JOBFILE_DIR = TARBALL_DIR+'/jobfiles' CHROOT_DIR = TMPDIR+'/chroots/pristine' WORKDIR = TMPDIR+'/work' +if os.environ.has_key('http_proxy'): + prefix = AUTOTUA_DIR+'/../../scripts/' + # If git-proxy-cmd.sh is in PATH, use that + for path in os.environ['PATH'].split(':'): + if os.access(path+"/git-proxy-cmd.sh", os.X_OK): + prefix = '' + os.environ['GIT_PROXY_COMMAND'] = prefix+'git-proxy-cmd.sh' + # Example: # http://gentoo.osuosl.org/releases/hppa/2008.0_beta2/stages/stage3-hppa2.0-2008.0_beta2.tar.bz2 GENTOO_MIRRORS = [ |