Fix the test scripts for the players for the new world -R 1 for fairland

and for -R 1 for the server.  Cleanup the shell selection for the current builds
and the push the shell fixes to the config files.  Add PATCH and
CVSROOT environment variables to add flexibility.  Add the changes for
the new autoconf build and remove build.conf and makedepend.
Swiitch All patch to use the source code All patches.
Fix the spelling of sandbox.
This commit is contained in:
Ron Koenderink 2007-11-12 20:08:15 +00:00
parent 6992bcfe9a
commit acfc17b05a

View file

@ -17,27 +17,7 @@
# CLEANUP - Remove the contents of the sandbox # CLEANUP - Remove the contents of the sandbox
# #
# For some reason, solaris sh exits as soon as both stderr and stdout
# are redirected to file at the exec, so if we run on solaris, use ksh
# for this script.
#
INTERPRETER="$_"
case "$INTERPRETER"
in
*/ksh|ksh)
;;
*)
if [ "`uname`" = "SunOS" ]
then
exec ksh "$0" "$@"
fi
;;
esac
PROGNAME="$0" PROGNAME="$0"
CVS_RSH=ssh
export CVS_RSH
TERM="${TERM:-vt100}" TERM="${TERM:-vt100}"
export TERM export TERM
@ -116,8 +96,10 @@ cd "${WORKDIR}" || err "Could not cd to ${BOXDIR}/${WORKDIR}"
echo "Getting source from CVS:" echo "Getting source from CVS:"
# Extract source # Extract source
export CVS_RSH=${CVS_RSH:=ssh}
export CVSROOT=${CVSROOT:=:pserver:anonymous@empserver.cvs.sourceforge.net:/cvsroot/empserver}
RETR=0 RETR=0
while ! cvs -z3 -d:ext:"${SFLOGIN}"@cvs.sourceforge.net:/cvsroot/empserver co empserver >/dev/null while ! cvs -z3 co empserver >/dev/null
do do
sleep "`expr 5 + ${RETR}`" sleep "`expr 5 + ${RETR}`"
RETR="`expr 1 + ${RETR}`" RETR="`expr 1 + ${RETR}`"
@ -140,11 +122,11 @@ in
*PATCH*) ;; *PATCH*) ;;
*) *)
echo "Applying global patches from patches/All:" echo "Applying global patches from ${BOXDIR}/${WORKDIR}/empserver/src/scripts/nightly/patches/All"
for i in "${SCRIPTDIR}/patches/All"/*.patch for i in "${BOXDIR}/${WORKDIR}/empserver/src/scripts/nightly/patches/All"/*.patch
do do
[ -r "${i}" ] || continue [ -r "${i}" ] || continue
if patch -Np0 < "${i}" >/dev/null if ${PATCH:=patch} -Np0 < "${i}" >/dev/null
then then
echo "${i}: OK" echo "${i}: OK"
else else
@ -170,7 +152,7 @@ then
for i in "${LOCALPATCHDIR}"/*.patch for i in "${LOCALPATCHDIR}"/*.patch
do do
[ -r "${i}" ] || continue [ -r "${i}" ] || continue
if patch -Np0 < "${i}" >/dev/null if ${PATCH:=patch} -Np0 < "${i}" >/dev/null
then then
echo "${i}: OK" echo "${i}: OK"
else else
@ -183,18 +165,9 @@ fi
cd empserver || err "Could not cd to ${BOXDIR}/${WORKDIR}/empserver." cd empserver || err "Could not cd to ${BOXDIR}/${WORKDIR}/empserver."
# Prep build.conf cvs up -d
echo "Preparing build.conf" sh ./bootstrap
sed -e "s,^USERNAME = .*$,USERNAME = ${EMPLOGIN}," \ ./configure --prefix ${BOXDIR}/${WORKDIR}/emp4
-e "s,^HOSTNAME = .*$,HOSTNAME = localhost," \
-e "s,^IPADDR = .*$,IPADDR = 127.0.0.1," \
-e "s,^PORTNUM = .*$,PORTNUM = ${EMPPORT}," \
-e "s,^EMPDIR = .*$,EMPDIR = ${BOXDIR}/${WORKDIR}/emp4," \
< build.conf > build.conf.new && \
mv build.conf.new build.conf || \
err "Could not prep build.conf"
echo "Done (build.conf)."
echo ""
;; ;;
esac esac
@ -210,11 +183,6 @@ in
*BUILD*) ;; *BUILD*) ;;
*) *)
# TODO: this should be fixed another way...
echo "Generating empty Makedepends."
touch src/client/Makedepend src/doconfig/Makedepend src/lib/as/Makedepend src/lib/commands/Makedepend src/lib/common/Makedepend src/lib/empthread/Makedepend src/lib/gen/Makedepend src/lib/global/Makedepend src/lib/lwp/Makedepend src/lib/player/Makedepend src/lib/subs/Makedepend src/lib/update/Makedepend src/server/Makedepend src/util/Makedepend || err "Could tot touch Makedepends"
echo "Done (touch)."
echo ""
# Start the build # Start the build
echo "Building server" echo "Building server"
@ -242,7 +210,7 @@ do
*GENERATE*) ;; *GENERATE*) ;;
*) *)
if [ -d ../emp4 -a -d ../emp4/bin -a -d ../emp4/data ] if [ -d ../emp4 -a -d ../emp4/bin -a -d ../emp4/sbin -a -d ../emp4/var/empire ]
then then
echo "Directory structure is ok" echo "Directory structure is ok"
else else
@ -252,7 +220,14 @@ do
cd ../emp4/bin || err "Could not cd to ../emp4/bin" cd ../emp4/bin || err "Could not cd to ../emp4/bin"
echo "Determining type of files in bindir" echo "Determining type of files in bin directory"
file *
echo "Done (file *)."
echo ""
cd ../../emp4/sbin || err "Could not cd to ../../emp4/sbin"
echo "Determining type of files in sbin directory"
file * file *
echo "Done (file *)." echo "Done (file *)."
echo "" echo ""
@ -300,6 +275,7 @@ do
*GENERATE*) ;; *GENERATE*) ;;
*) *)
ln -s ../bin/empire emp_client
echo "Running newcap_script through emp_client" echo "Running newcap_script through emp_client"
runfeed POGO peter < newcap_script >/dev/null 2>&1 || runfeed POGO peter < newcap_script >/dev/null 2>&1 ||
{ {
@ -364,40 +340,42 @@ expl c 0,0 1 yh
expl c 0,0 1 gh expl c 0,0 1 gh
expl c 0,0 1 bh expl c 0,0 1 bh
desi * ?ne=- + desi * ?ne=- +
expl c 2,0 1 njh
expl c 2,0 1 nnh
expl c 2,0 1 bnh expl c 2,0 1 bnh
expl c 2,0 1 bbh expl c 0,0 1 bbh
expl c 0,0 1 bgh
expl c 0,0 1 ggh
expl c 0,0 1 gyh
expl c 0,0 1 yyh expl c 0,0 1 yyh
expl c 2,0 1 yyh expl c 0,0 1 yuh
expl c 2,0 1 uyh expl c 0,0 1 bnh
expl c 2,0 1 yuh
expl c 2,0 1 uuh expl c 2,0 1 uuh
expl c 2,0 1 juh
desi * ?ne=- + desi * ?ne=- +
expl c 2,0 1 bbnh expl c 2,0 1 nnnh
expl c 2,0 1 uuuh expl c 2,0 1 nnjh
expl c 2,0 1 yyyh expl c 2,0 1 njjh
expl c 0,0 1 yyyh expl c 2,0 1 uujh
expl c 0,0 1 bbnh
expl c 0,0 1 bnnh
expl c 0,0 1 yygh expl c 0,0 1 yygh
expl c 0,0 1 yggh expl c 0,0 1 yuuh
expl c 0,0 1 gggh
expl c 0,0 1 ggbh
desi * ?ne=- + desi * ?ne=- +
expl c 0,0 1 ggggh expl c 2,0 1 nnjjh
expl c 0,0 1 gggbh desi * ?ne=- +
expl c 0,0 1 ggbbh expl c 2,0 1 nnjjjh
desi * ?ne=- + desi * ?ne=- +
mov u 0,0 75 jh mov u 0,0 75 jh
demob 0:2,0 55 y demob 0:2,0 55 y
desi 2,0 m desi 2,0 m
mov c 0,0 767 -3,-1 mov c 0,0 767 -1,-1
desi -3,-1 g desi -1,-1 g
mov c 0,0 270 1,-1 mov c 0,0 275 1,-1
mov c 2,0 274 1,-1 mov c 2,0 274 1,-1
desi 1,-1 m desi 1,-1 m
deliver i 2,0 120 u deliver i 2,0 230 u
dist 2,-2 2,0 deliver i 1,-1 0 j
thre i 2,-2 1000 dist 4,0 2,0
thres i 2,0 1
EOF EOF
echo "Run an update" echo "Run an update"
@ -415,7 +393,7 @@ EOF
sleep 10 sleep 10
echo "Check player 1" echo "Check player 1"
runfeed 1 << EOF runfeed 1 << EOF
real 0 -12:10,-5:5 real 0 -8:12,-4:4
cen * cen *
map # map #
read y read y
@ -440,22 +418,22 @@ EOF
echo "Turn 2 for player 1" echo "Turn 2 for player 1"
runfeed 1 << EOF >/dev/null 2>&1 runfeed 1 << EOF >/dev/null 2>&1
desi -3,-1 b desi -1,-1 b
mov i 1,-1 120 2,-2 mov i 2,0 200 4,0
mov i 1,-1 4 jh mov i 1,-1 4 jh
mov c -3,-1 435 2,-2 mov c -1,-1 435 4,0
deli i 2,0 0 u deli i 2,0 0 j
deli i 1,-1 0 u deli i 1,-1 0 j
mov c -3,-1 80 3,-1 mov c -1,-1 80 3,-1
mov c 1,-1 256 4,-2 mov c 1,-1 256 4,0
mov c 2,0 230 3,-1 mov c 2,0 230 5,-1
mov c 1,-1 409 3,-1 mov c 1,-1 409 3,-1
desi 2,-2 k desi 4,0 k
desi 3,-1 j desi 3,-1 j
dist # 4,-2 dist # 5,-1
thre h 2,-2 1 thre h 4,0 1
thre l 3,-1 1 thre l 3,-1 1
desi 4,-2 h desi 5,-1 h
EOF EOF
echo "Run an update" echo "Run an update"
@ -476,27 +454,21 @@ EOF
cen * cen *
map # map #
read y read y
build sh 4,-2 frg build sh 5,-1 frg
mov l 3,-1 1 -8,0 mov l 5,-1 134 6,-2
mov l 4,-2 193 -8,0 mov c 4,0 377 6,-2
mov i 1,-1 1 2,-2 desi 6,-2 l
mov c 2,-2 377 -8,0 thre l 6,-2 150
desi -8,0 l mov c -1,-1 600 1,1
thre l -8,0 150 mov c 2,0 370 -2,2
mov c -3,-1 627 -2,0 deliver i 2,0 0 j
mov c 3,-1 139 -2,0 deliver i 1,-1 0 j
mov c 4,-2 292 uh thres d 1,1 1
mov c 2,-2 36 -7,1 thres o -2,0 1
mov c 3,-1 29 -7,1 thres i 2,0 0
mov c 2,0 191 -7,1 thres i 1,-1 0
mov c 2,0 125 5,-3 desi -2,2 o
mov u 2,0 99 yh desi 1,1 g
deliver o 5,-3 0 b
deliver d -2,0 0 y
desi -7,1 h
desi 5,-3 o
desi -2,0 g
budg h 1
prod * prod *
EOF EOF
@ -560,7 +532,7 @@ in
*) *)
echo "Cleaning sandbox" echo "Cleaning sandbox"
cd "${BOXDIR}" || err "Could not cd back to sanbox root !" cd "${BOXDIR}" || err "Could not cd back to sandbox root !"
rm -r "${WORKDIR}" || warn "Directory ${WORKDIR} could not be cleanly removed !" rm -r "${WORKDIR}" || warn "Directory ${WORKDIR} could not be cleanly removed !"
rm -rf "${WORKDIR}" || warn "Directory ${WORKDIR} could not be forcibly removed !" rm -rf "${WORKDIR}" || warn "Directory ${WORKDIR} could not be forcibly removed !"
[ -d "${WORKDIR}/." ] && warn "Directory ${WORKDIR} still present" [ -d "${WORKDIR}/." ] && warn "Directory ${WORKDIR} still present"