Added subversion config.
authorIain Patterson <me@iain.cx>
Thu, 28 Jun 2007 08:42:43 +0000 (08:42 +0000)
committerIain Patterson <me@iain.cx>
Thu, 28 Jun 2007 08:42:43 +0000 (08:42 +0000)
Added proxy.bashrc to get proxy information from .subversion/servers.

git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@57 6be0d1a5-5cfe-0310-89b6-964be062b18b

.profile.d/proxy.bashrc [new file with mode: 0644]
.subversion/config [new file with mode: 0644]

diff --git a/.profile.d/proxy.bashrc b/.profile.d/proxy.bashrc
new file mode 100644 (file)
index 0000000..811fcbd
--- /dev/null
@@ -0,0 +1,13 @@
+# $Id$
+# Read proxy information from Subversion if possible.
+
+servers=~/.subversion/servers
+
+if [ -r "$servers" ]; then
+  eval $(sed -n '/^\[global\]/,/^\[/s/^http-proxy-\([^= ]*\) *= *\(.*\)/proxy_\1="\2"/p' "$servers")
+  creds=""
+  [ ! -z "$proxy_username" ] && creds="$proxy_username:$proxy_password@"
+  export http_proxy="http://$creds$proxy_host:${proxy_port:-80}"
+fi
+
+unset proxy_username proxy_password proxy_host proxy_port creds servers
diff --git a/.subversion/config b/.subversion/config
new file mode 100644 (file)
index 0000000..7e25f99
--- /dev/null
@@ -0,0 +1,4 @@
+# $Id$
+
+[helpers]
+editor-cmd = vim