aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek.chauhan@gmail.com>2008-08-09 01:00:03 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2008-08-09 01:00:03 +0530
commit23c8ce789ef35726c8d064f23162ba47fe4a5d25 (patch)
treef58bafb92866014cfecdac9c68da1c377502ff9c
parent- Implement post() and emerge() (diff)
downloadautotua-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-xscripts/git-proxy-cmd.sh8
-rw-r--r--slave/autotua/const.py9
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 = [