3 # This MUST be in the form
4 # http://anonsvn.wireshark.org/wireshark-win32-libs/tags/<date>/packages
5 # in order to provide backward compatibility with older trees (e.g. a
6 # previous release or an older SVN checkout).
7 DOWNLOAD_PREFIX="http://anonsvn.wireshark.org/wireshark-win32-libs/tags/2006-11-26/packages"
18 echo " $0 --appverify <appname> [<appname>] ..."
19 echo " $0 --download <destination> <subdirectory> <package>"
31 echo "Checking for required applications:"
32 which which > /dev/null 2>&1 || \
33 err_exit "Can't find 'which'. Unable to proceed."
35 APP_PATH=`cygpath --unix $APP`
36 if [ -x "$APP_PATH" -a ! -d "$APP_PATH" ] ; then
39 APP_LOC=`which $APP_PATH 2> /dev/null`
41 if [ "$APP_LOC" = "" ] ; then
42 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!"
44 echo " $APP: $APP_LOC $res"
48 if [ -z "$2" -o -z "$3" -o -z "$4" ] ; then
51 DEST_PATH=`cygpath --dos "$2"`
54 PACKAGE=`basename "$PACKAGE_PATH"`
55 echo "****** $PACKAGE ******"
56 if [ -z "$http_proxy" -a -z "$HTTP_PROXY" ] ; then
57 echo "No HTTP proxy specified (http_proxy and HTTP_PROXY are empty)."
58 # a proxy might also be specified using .wgetrc, so don't switch off the proxy
62 if [ -z "$http_proxy" ] ; then
63 echo "HTTP proxy ($HTTP_PROXY) has been specified and will be used."
65 echo "HTTP proxy ($http_proxy) has been specified and will be used."
68 echo "Downloading $4 into $DEST_PATH, installing into $3"
69 if [ ! -d "$DEST_PATH/$DEST_SUBDIR" ] ; then
70 mkdir -p "$DEST_PATH/$DEST_SUBDIR" || \
71 err_exit "Can't create $DEST_PATH/$DEST_SUBDIR"
73 cd "$DEST_PATH" || err_exit "Can't find $DEST_PATH"
74 wget $use_proxy -nc "$DOWNLOAD_PREFIX/$PACKAGE_PATH" || \
75 err_exit "Can't download $DOWNLOAD_PREFIX/$PACKAGE_PATH"
76 cd "$DEST_SUBDIR" || err_exit "Can't find $DEST_SUBDIR"
77 echo "Extracting $DEST_PATH/$PACKAGE into $DEST_PATH/$DEST_SUBDIR"
78 unzip -nq "$DEST_PATH/$PACKAGE" ||
79 err_exit "Couldn't unpack $DEST_PATH/$PACKAGE"
80 echo "Verifying that the DLLs in $DEST_PATH/$DEST_SUBDIR are executable."
81 for i in `/usr/bin/find $DEST_PATH/$DEST_SUBDIR -name \*\.dll` ; do
82 if [ ! -x "$i" ] ; then
83 echo "Changing file permissions (add executable bit) to:"