1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

Ralph Mitchell's update that allows this script to take an existing

directory name and build/run/test curl in there instead of trying to update
from CVS. Using this approach, this script can be used to test daily tarballs
etc.
This commit is contained in:
Daniel Stenberg 2003-11-07 08:06:03 +00:00
parent b1aa8eb7ef
commit 3de511b248

View File

@ -1,4 +1,5 @@
#!/bin/sh
###########################
# What is This Script?
###########################
@ -11,12 +12,26 @@
# curl site, at http://curl.haxx.se/auto/
# USAGE:
# testcurl.sh > output
# testcurl.sh [curl-daily-name] > output
# Updated:
# v1.1 6-Nov-03 - to take an optional parameter, the name of a daily-build
# directory. If present, build from that directory, otherwise
# perform a normal CVS build.
# version of this script
version=1
version=1.1
fixed=0
# Determine if we're running from CVS or a canned copy of curl
if [ "$#" -ge "1" -a "$1" ]; then
CURLDIR=$1
CVS=0
else
CURLDIR="curl"
CVS=1
fi
LANG="C"
export LANG
@ -29,6 +44,8 @@ die(){
if [ -f setup ]; then
. "./setup"
infixed="$fixed"
else
infixed=0 # so that "additional args to configure" works properly first time...
fi
if [ -z "$name" ]; then
@ -80,13 +97,16 @@ echo "testcurl: date = `date -u`"
ipwd=`pwd`
pwd=`echo $ipwd | sed -e 's/$//g'`
if [ -d curl -a -d curl/CVS ]; then
if [ -d "$CURLDIR" ]; then
if [ $CVS -eq 1 -a -d $CURLDIR/CVS ]; then
echo "testcurl: curl is verified to be a fine source dir"
else
echo "testcurl: curl is not a source dir checked out from CVS!"
elif [ $CVS -eq 0 -a -f $CURLDIR/testcurl.sh ]; then
echo "testcurl: curl is verified to be a fine daily source dir"
else
echo "testcurl: curl is not a daily source dir or checked out from CVS!"
die
fi
fi
build="build-$$"
# remove any previous left-overs
@ -103,11 +123,13 @@ else
fi
# get in the curl source tree root
cd curl
cd $CURLDIR
echo "testcurl: update from CVS"
# Do the CVS thing, or not...
if [ $CVS -eq 1 ]; then
echo "testcurl: update from CVS"
cvsup() {
cvsup() {
# update quietly to the latest CVS
echo "testcurl: run cvs up"
cvs -Q up -dP 2>&1
@ -117,10 +139,10 @@ cvsup() {
# return (1 - RETURNVALUE) so that errors return 0 while goodness
# returns 1
return `expr 1 - $cvsstat`
}
}
att="0"
while cvsup; do
att="0"
while cvsup; do
att=`expr $att + 1`
echo "testcurl: failed CVS update attempt number $att."
if [ $att -gt 10 ]; then
@ -128,21 +150,21 @@ while cvsup; do
break # get out of the loop
fi
sleep 5
done
done
echo "testcurl: cvs returned: $cvsstat"
echo "testcurl: cvs returned: $cvsstat"
if [ "$cvsstat" -ne "0" ]; then
if [ "$cvsstat" -ne "0" ]; then
echo "testcurl: failed to update from CVS, exiting"
die
fi
fi
# figure out the current collected CVS status
newstat="../allcvs.log"
oldstat="../oldcvs.log"
find . -name Entries -exec cat {} \; > "$newstat"
# figure out the current collected CVS status
newstat="../allcvs.log"
oldstat="../oldcvs.log"
find . -name Entries -exec cat {} \; > "$newstat"
if [ -r "$oldstat" ]; then
if [ -r "$oldstat" ]; then
# there is a previous cvs stat file to compare with
if { cmp "$oldstat" "$newstat"; } then
echo "testcurl: this is the same CVS status as before"
@ -151,15 +173,16 @@ if [ -r "$oldstat" ]; then
else
echo "testcurl: there has been a change in the CVS"
fi
fi
# remove possible left-overs from the past
rm -f configure
rm -rf autom4te.cache
# generate the build files
./buildconf 2>&1
fi
# remove possible left-overs from the past
rm -f configure
rm -rf autom4te.cache
# generate the build files
./buildconf 2>&1
if [ -f configure ]; then
echo "testcurl: configure created"
else
@ -171,7 +194,7 @@ fi
cd "../$build"
# run configure script
../curl/configure $confopts 2>&1
../$CURLDIR/configure $confopts 2>&1
if [ -f lib/Makefile ]; then
echo "testcurl: configure seems to have finished fine"
@ -191,7 +214,7 @@ if { grep USE_ARES lib/config.h; } then
# run the ares configure
cd ares
../../curl/ares/configure 2>&1
../../$CURLDIR/ares/configure 2>&1
echo "testcurl: build ares"
make
@ -220,8 +243,10 @@ else
echo "testcurl: the tests were successful!"
fi
# store the cvs status for the next time
mv $newstat $oldstat
if [ $CVS -eq 1 ]; then
# store the cvs status for the next time
mv $newstat $oldstat
fi
# get out of dir
cd ..