From 7abe4f24a3b77a1507ab0d1c994c3f5052aa0fe9 Mon Sep 17 00:00:00 2001 From: Osamu Habuka Date: Wed, 25 Jul 2012 12:39:32 +0900 Subject: [PATCH] support no_proxy environment variable Change-Id: I5175f9752abe358cca0d2e3e5cf6d94605df451a --- AUTHORS | 1 + functions | 4 ++++ stack.sh | 9 +++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 6141d675e2..2bf494193d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -29,6 +29,7 @@ Josh Kearney Justin Shepherd Ken Pepple Kiall Mac Innes +Osamu Habuka Russell Bryant Scott Moser Thierry Carrez diff --git a/functions b/functions index 46a6f8a469..2f5cdbc5db 100644 --- a/functions +++ b/functions @@ -17,6 +17,7 @@ function apt_get() { [[ "$(id -u)" = "0" ]] && sudo="env" $sudo DEBIAN_FRONTEND=noninteractive \ http_proxy=$http_proxy https_proxy=$https_proxy \ + no_proxy=$no_proxy \ apt-get --option "Dpkg::Options::=--force-confold" --assume-yes "$@" } @@ -479,6 +480,7 @@ function pip_install { sudo PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE:-/var/cache/pip} \ HTTP_PROXY=$http_proxy \ HTTPS_PROXY=$https_proxy \ + NO_PROXY=$no_proxy \ $CMD_PIP install --use-mirrors $@ } @@ -509,6 +511,7 @@ function setup_develop() { sudo \ HTTP_PROXY=$http_proxy \ HTTPS_PROXY=$https_proxy \ + NO_PROXY=$no_proxy \ python setup.py develop \ ) } @@ -562,6 +565,7 @@ function yum_install() { local sudo="sudo" [[ "$(id -u)" = "0" ]] && sudo="env" $sudo http_proxy=$http_proxy https_proxy=$https_proxy \ + no_proxy=$no_proxy \ yum install -y "$@" } diff --git a/stack.sh b/stack.sh index 0fbb957ac8..5d2627aafb 100755 --- a/stack.sh +++ b/stack.sh @@ -60,16 +60,21 @@ fi source $TOP_DIR/stackrc # HTTP and HTTPS proxy servers are supported via the usual environment variables -# ``http_proxy`` and ``https_proxy``. They can be set in ``localrc`` if necessary +# ``http_proxy`` and ``https_proxy``. Additionally if you would like to access +# to specific server directly and not through the proxy server, you can use +# ``no_proxy`` environment variable. They can be set in ``localrc`` if necessary # or on the command line:: # -# http_proxy=http://proxy.example.com:3128/ ./stack.sh +# http_proxy=http://proxy.example.com:3128/ no_proxy=repo.example.net ./stack.sh if [[ -n "$http_proxy" ]]; then export http_proxy=$http_proxy fi if [[ -n "$https_proxy" ]]; then export https_proxy=$https_proxy fi +if [[ -n "$no_proxy" ]]; then + export no_proxy=$no_proxy +fi # Destination path for installation ``DEST`` DEST=${DEST:-/opt/stack}