2004-04-08 20:36:09 +00:00
|
|
|
#!/bin/sh
|
2007-05-11 22:54:54 +00:00
|
|
|
#
|
|
|
|
# $Id$
|
2004-04-08 20:36:09 +00:00
|
|
|
|
2006-09-27 18:02:40 +00:00
|
|
|
# This MUST be in the form
|
|
|
|
# http://anonsvn.wireshark.org/wireshark-win32-libs/tags/<date>/packages
|
|
|
|
# in order to provide backward compatibility with older trees (e.g. a
|
|
|
|
# previous release or an older SVN checkout).
|
2007-05-14 17:07:34 +00:00
|
|
|
DOWNLOAD_PREFIX="http://anonsvn.wireshark.org/wireshark-win32-libs/tags/2007-05-14/packages"
|
2006-11-12 22:18:50 +00:00
|
|
|
|
|
|
|
# Set DOWNLOAD_PREFIX to /packages to test uploads before creating the tag.
|
|
|
|
#DOWNLOAD_PREFIX="http://anonsvn.wireshark.org/wireshark-win32-libs/trunk/packages/"
|
2004-04-08 20:36:09 +00:00
|
|
|
|
|
|
|
err_exit () {
|
2005-07-07 21:26:09 +00:00
|
|
|
echo ""
|
2004-04-08 20:36:09 +00:00
|
|
|
echo "ERROR: $1"
|
|
|
|
echo ""
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
usage () {
|
|
|
|
echo "Usage:"
|
|
|
|
echo " $0 --appverify <appname> [<appname>] ..."
|
|
|
|
echo " $0 --download <destination> <subdirectory> <package>"
|
|
|
|
echo ""
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
case "$1" in
|
2004-04-25 22:14:43 +00:00
|
|
|
--appverify)
|
2004-04-08 20:36:09 +00:00
|
|
|
shift
|
2004-04-25 22:14:43 +00:00
|
|
|
if [ -z "$*" ] ; then
|
2004-04-08 20:36:09 +00:00
|
|
|
usage
|
|
|
|
fi
|
|
|
|
echo "Checking for required applications:"
|
2005-07-07 21:26:09 +00:00
|
|
|
which which > /dev/null 2>&1 || \
|
|
|
|
err_exit "Can't find 'which'. Unable to proceed."
|
2004-04-08 20:36:09 +00:00
|
|
|
for APP in $* ; do
|
2004-04-09 16:54:07 +00:00
|
|
|
APP_PATH=`cygpath --unix $APP`
|
|
|
|
if [ -x "$APP_PATH" -a ! -d "$APP_PATH" ] ; then
|
|
|
|
APP_LOC="$APP_PATH"
|
|
|
|
else
|
|
|
|
APP_LOC=`which $APP_PATH 2> /dev/null`
|
|
|
|
fi
|
2004-04-25 22:14:43 +00:00
|
|
|
if [ "$APP_LOC" = "" ] ; then
|
2006-02-26 18:21:50 +00:00
|
|
|
err_exit "Can't find $APP. This is probably an optional cygwin package not yet installed. Try to install it using cygwin's setup.exe!"
|
2004-04-08 20:36:09 +00:00
|
|
|
fi
|
|
|
|
echo " $APP: $APP_LOC $res"
|
|
|
|
done
|
|
|
|
;;
|
2004-04-25 22:14:43 +00:00
|
|
|
--download)
|
|
|
|
if [ -z "$2" -o -z "$3" -o -z "$4" ] ; then
|
2004-04-08 20:36:09 +00:00
|
|
|
usage
|
|
|
|
fi
|
2006-08-30 21:51:31 +00:00
|
|
|
DEST_PATH=`cygpath --dos "$2"`
|
2004-04-08 20:36:09 +00:00
|
|
|
DEST_SUBDIR=$3
|
|
|
|
PACKAGE_PATH=$4
|
|
|
|
PACKAGE=`basename "$PACKAGE_PATH"`
|
2004-05-01 06:21:07 +00:00
|
|
|
echo "****** $PACKAGE ******"
|
2004-08-17 08:47:30 +00:00
|
|
|
if [ -z "$http_proxy" -a -z "$HTTP_PROXY" ] ; then
|
|
|
|
echo "No HTTP proxy specified (http_proxy and HTTP_PROXY are empty)."
|
2006-09-11 22:37:46 +00:00
|
|
|
# a proxy might also be specified using .wgetrc, so don't switch off the proxy
|
|
|
|
#use_proxy="-Y off"
|
2004-04-25 22:14:43 +00:00
|
|
|
else
|
|
|
|
use_proxy="-Y on"
|
2004-08-17 08:47:30 +00:00
|
|
|
if [ -z "$http_proxy" ] ; then
|
|
|
|
echo "HTTP proxy ($HTTP_PROXY) has been specified and will be used."
|
2007-05-11 22:54:54 +00:00
|
|
|
export http_proxy=$HTTP_PROXY
|
2004-08-17 08:47:30 +00:00
|
|
|
else
|
|
|
|
echo "HTTP proxy ($http_proxy) has been specified and will be used."
|
|
|
|
fi
|
2004-04-25 22:14:43 +00:00
|
|
|
fi
|
2004-04-08 20:36:09 +00:00
|
|
|
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"
|
2004-04-25 22:14:43 +00:00
|
|
|
wget $use_proxy -nc "$DOWNLOAD_PREFIX/$PACKAGE_PATH" || \
|
2004-04-08 20:36:09 +00:00
|
|
|
err_exit "Can't download $DOWNLOAD_PREFIX/$PACKAGE_PATH"
|
2004-05-01 06:21:07 +00:00
|
|
|
cd "$DEST_SUBDIR" || err_exit "Can't find $DEST_SUBDIR"
|
2004-04-08 20:36:09 +00:00
|
|
|
echo "Extracting $DEST_PATH/$PACKAGE into $DEST_PATH/$DEST_SUBDIR"
|
2007-01-17 19:14:11 +00:00
|
|
|
unzip -oq "$DEST_PATH/$PACKAGE" ||
|
2004-04-08 20:36:09 +00:00
|
|
|
err_exit "Couldn't unpack $DEST_PATH/$PACKAGE"
|
2004-04-26 17:21:22 +00:00
|
|
|
echo "Verifying that the DLLs in $DEST_PATH/$DEST_SUBDIR are executable."
|
2004-12-01 16:56:37 +00:00
|
|
|
for i in `/usr/bin/find $DEST_PATH/$DEST_SUBDIR -name \*\.dll` ; do
|
2004-04-26 17:21:22 +00:00
|
|
|
if [ ! -x "$i" ] ; then
|
|
|
|
echo "Changing file permissions (add executable bit) to:"
|
|
|
|
echo "$i"
|
|
|
|
chmod a+x "$i"
|
|
|
|
fi
|
2006-04-12 20:36:31 +00:00
|
|
|
done
|
2004-04-08 20:36:09 +00:00
|
|
|
;;
|
2004-04-25 22:14:43 +00:00
|
|
|
*)
|
2004-04-08 20:36:09 +00:00
|
|
|
usage
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|