Commit 3de511b2 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

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.
parent b1aa8eb7
Loading
Loading
Loading
Loading
+89 −64
Original line number Diff line number Diff line
#!/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"
  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 source dir checked out from CVS!"
    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,8 +123,10 @@ else
fi

# get in the curl source tree root
cd curl
cd $CURLDIR

# Do the CVS thing, or not...
if [ $CVS -eq 1 ]; then
  echo "testcurl: update from CVS"

  cvsup() {
@@ -159,6 +181,7 @@ rm -rf autom4te.cache

  # generate the build files
  ./buildconf 2>&1
fi

if [ -f configure ]; then
  echo "testcurl: configure created"
@@ -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

if [ $CVS -eq 1 ]; then
  # store the cvs status for the next time
  mv $newstat $oldstat
fi

# get out of dir
cd ..