Add "--windowsonly" and "--cygwinonly" options to win-setup.sh

--appverify.  Make sure "mt" is only found in a normaly Windows path and
"find" is only found in a Cygwin path.

svn path=/trunk/; revision=38781
This commit is contained in:
Gerald Combs 2011-08-29 19:22:42 +00:00
parent 6c3a7ca052
commit cd7da58daa
2 changed files with 27 additions and 8 deletions

View File

@ -722,14 +722,14 @@ REQUIRED_TOOLS=\
$(LINK) \ $(LINK) \
nmake \ nmake \
!IFDEF MANIFEST_INFO_REQUIRED !IFDEF MANIFEST_INFO_REQUIRED
mt \ --windowsonly mt \
!ENDIF !ENDIF
$(SH_PROG) \ $(SH_PROG) \
$(YACC) \ $(YACC) \
$(LEX) \ $(LEX) \
env \ env \
grep \ grep \
/usr/bin/find \ --cygwinonly /usr/bin/find \
$(PERL) \ $(PERL) \
$(PYTHON) \ $(PYTHON) \
sed \ sed \

View File

@ -13,11 +13,11 @@
# Save previous tag. # Save previous tag.
if [ -z "$DOWNLOAD_TAG" ]; then if [ -z "$DOWNLOAD_TAG" ]; then
err_exit "DOWNLOAD_TAG not defined (internal error)" err_exit "DOWNLOAD_TAG not defined (internal error)"
fi fi
if [ -z "$WIRESHARK_TARGET_PLATFORM" ]; then if [ -z "$WIRESHARK_TARGET_PLATFORM" ]; then
err_exit "WIRESHARK_TARGET_PLATFORM not defined (internal error)" err_exit "WIRESHARK_TARGET_PLATFORM not defined (internal error)"
fi fi
# Set DOWNLOAD_PREFIX to /packages to test uploads before creating the tag. # Set DOWNLOAD_PREFIX to /packages to test uploads before creating the tag.
@ -31,7 +31,7 @@ err_exit () {
echo "ERROR: $1" echo "ERROR: $1"
shift shift
for str in "$@" ; do for str in "$@" ; do
echo "$str" echo "$str"
done done
echo "" echo ""
exit 1 exit 1
@ -97,26 +97,45 @@ find_proxy() {
case "$1" in case "$1" in
--appverify) --appverify)
shift shift
if [ -z "$*" ] ; then if [ -z "$*" ] ; then
usage usage
fi fi
echo "Checking for required applications:" echo "Checking for required applications:"
which which > /dev/null 2>&1 || \ which which > /dev/null 2>&1 || \
err_exit "Can't find 'which'. Unable to proceed." err_exit "Can't find 'which'. Unable to proceed."
MISSING_APPS= MISSING_APPS=
PATH_RE=""
for APP in $* ; do for APP in $* ; do
APP_PATH=`cygpath --unix $APP`
case "$APP" in
--windowsonly)
PATH_RE="^/cygdrive/.*/"
continue
;;
--cygwinonly)
PATH_RE="^/usr/.*/"
continue
;;
esac
APP_PATH=`cygpath --unix "$APP"`
if [ -x "$APP_PATH" -a ! -d "$APP_PATH" ] ; then if [ -x "$APP_PATH" -a ! -d "$APP_PATH" ] ; then
APP_LOC="$APP_PATH" APP_LOC="$APP_PATH"
else else
APP_LOC=`which $APP_PATH 2> /dev/null` APP_LOC=`which $APP_PATH 2> /dev/null`
fi fi
if [ "$APP_LOC" = "" ] ; then echo "$APP_LOC" | grep "$PATH_RE" > /dev/null 2>&1
IN_PATH=$?
if [ "$APP_LOC" = "" -o $IN_PATH -ne 0 ] ; then
MISSING_APPS="$MISSING_APPS $APP" MISSING_APPS="$MISSING_APPS $APP"
else else
echo " $APP: $APP_LOC $res" echo " $APP: $APP_LOC $res"
fi fi
PATH_RE=""
done done
if [ -n "$MISSING_APPS" ]; then if [ -n "$MISSING_APPS" ]; then
@ -134,7 +153,7 @@ case "$1" in
PACKAGE_PATH=$4 PACKAGE_PATH=$4
PACKAGE=`basename "$PACKAGE_PATH"` PACKAGE=`basename "$PACKAGE_PATH"`
if [ ! -e $DEST_PATH/$PACKAGE ] ; then if [ ! -e $DEST_PATH/$PACKAGE ] ; then
err_exit "Package $PACKAGE is needed but is apparently not downloaded; 'nmake -f ... setup' required ?" err_exit "Package $PACKAGE is needed but is apparently not downloaded; 'nmake -f ... setup' required ?"
fi fi
;; ;;
--download) --download)