- Fixed usage explanation, and added tests for valid tag/arch

This commit is contained in:
Cas Cremers 2007-05-20 14:13:38 +02:00
parent e1d0e0f273
commit 2279190b18

38
dist/gitdist.sh vendored
View File

@ -18,16 +18,43 @@
# and this is used to construct a archive with the binary of the # and this is used to construct a archive with the binary of the
# selected architecture. # selected architecture.
CURDIR=`pwd` if [ "x$1" = "x" -o "x$2" = "x" ]
echo $CURDIR then
echo
echo "Scyther binary distribution generator."
echo
echo " Usage: $0 <arch> <tag>"
echo
echo "where <arch> is one of linux,w32,mac"
echo "and <tag> is any tag in the current git repository."
echo
exit
fi
ARCH="w32" ARCH=$1
TAG="test" if [ "x$ARCH" = "xlinux" -o "x$ARCH" = "xw32" -o "x$ARCH" = "xmac" ]
then
echo "Architecture $ARCH detected."
else
echo "Don't know architecture $ARCH"
exit
fi
TAG=$2
FOUND=`git-tag -l $TAG`
if [ "x$TAG" = "x$FOUND" ]
then
echo "Tag $TAG found."
else
echo "Don't know tag $TAG"
exit
fi
# Note without extension, this will added later # Note without extension, this will added later
ARCHNAME=scyther-$ARCH-$TAG ARCHNAME=scyther-$ARCH-$TAG
# Directory locations # Directory locations
CURDIR=`pwd`
DESTDIR=$CURDIR DESTDIR=$CURDIR
TMPDIR="/tmp" TMPDIR="/tmp"
SRCNAME=$ARCHNAME-src SRCNAME=$ARCHNAME-src
@ -83,9 +110,6 @@ then
cmake $CMFLAGS -D TARGETOS=MacPPC . && make cmake $CMFLAGS -D TARGETOS=MacPPC . && make
cmake $CMFLAGS -D TARGETOS=MacIntel . && make cmake $CMFLAGS -D TARGETOS=MacIntel . && make
cmake $CMFLAGS . && make scyther-mac cmake $CMFLAGS . && make scyther-mac
else
echo "Don't know this architecture $ARCH"
exit
fi fi
# Copy the resulting binary to the correct location # Copy the resulting binary to the correct location