aboutsummaryrefslogtreecommitdiffstats
path: root/tools/win32-setup.sh
diff options
context:
space:
mode:
authorOlivier Biot <obiot.ethereal@gmail.com>2004-04-25 22:14:43 +0000
committerOlivier Biot <obiot.ethereal@gmail.com>2004-04-25 22:14:43 +0000
commit094359e9f8bd6bc06990a424fffeb91158f3d90d (patch)
tree1ad6a52700bdd2529de90f932755a76c4a476ff1 /tools/win32-setup.sh
parentd40c7940f0193386f92e5f52cc24c20411ab3aad (diff)
Add code for HTTP proxy detection based on the http_proxy shell variable.
Fix the tests with string equal empty_string: "$str" == "" is either "$str" = "" or -z "$str" svn path=/trunk/; revision=10703
Diffstat (limited to 'tools/win32-setup.sh')
-rw-r--r--tools/win32-setup.sh21
1 files changed, 14 insertions, 7 deletions
diff --git a/tools/win32-setup.sh b/tools/win32-setup.sh
index a2c3b4195a..ddc8ca61fc 100644
--- a/tools/win32-setup.sh
+++ b/tools/win32-setup.sh
@@ -18,9 +18,9 @@ usage () {
case "$1" in
-'--appverify')
+--appverify)
shift
- if [ "$*" == "" ] ; then
+ if [ -z "$*" ] ; then
usage
fi
echo "Checking for required applications:"
@@ -31,34 +31,41 @@ case "$1" in
else
APP_LOC=`which $APP_PATH 2> /dev/null`
fi
- if [ "$APP_LOC" == "" ] ; then
+ if [ "$APP_LOC" = "" ] ; then
err_exit "Can't find $APP"
fi
echo " $APP: $APP_LOC $res"
done
;;
-'--download')
- if [ "$2" == "" -o "$3" == "" -o "$4" == "" ] ; then
+--download)
+ if [ -z "$2" -o -z "$3" -o -z "$4" ] ; then
usage
fi
DEST_PATH=`cygpath --unix "$2"`
DEST_SUBDIR=$3
PACKAGE_PATH=$4
PACKAGE=`basename "$PACKAGE_PATH"`
+ if [ -z "$http_proxy" ] ; then
+ echo "No HTTP proxy specified (http_proxy is empty)."
+ use_proxy="-Y off"
+ else
+ echo "HTTP proxy ($http_proxy) has been specified and will be used."
+ use_proxy="-Y on"
+ fi
echo "Downloading $4 into $DEST_PATH, installing into $3"
if [ ! -d "$DEST_PATH/$DEST_SUBDIR" ] ; then
mkdir -p "$DEST_PATH/$DEST_SUBDIR" || \
err_exit "Can't create $DEST_PATH/$DEST_SUBDIR"
fi
cd "$DEST_PATH" || err_exit "Can't find $DEST_PATH"
- wget -nc "$DOWNLOAD_PREFIX/$PACKAGE_PATH" || \
+ wget $use_proxy -nc "$DOWNLOAD_PREFIX/$PACKAGE_PATH" || \
err_exit "Can't download $DOWNLOAD_PREFIX/$PACKAGE_PATH"
cd $DEST_SUBDIR
echo "Extracting $DEST_PATH/$PACKAGE into $DEST_PATH/$DEST_SUBDIR"
unzip -nq "$DEST_PATH/$PACKAGE" ||
err_exit "Couldn't unpack $DEST_PATH/$PACKAGE"
;;
-'*')
+*)
usage
;;
esac