2006-03-10 22:49:07 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# This shell script is used to make a nightly GNUstep/SDL build from
|
|
|
|
# cron. It is intended to update an rsync repository.
|
|
|
|
#
|
|
|
|
# Arguments:
|
|
|
|
# tools/mknightly <destination>
|
|
|
|
#
|
|
|
|
# where destination is the rsync repository. The destination must already
|
|
|
|
# exist.
|
|
|
|
#
|
|
|
|
# The script should be run from the root of the svn working copy.
|
|
|
|
#
|
|
|
|
# Dylan Smith, 2006-03-10
|
|
|
|
#
|
|
|
|
|
|
|
|
OS=`uname`
|
2006-03-10 22:59:37 +00:00
|
|
|
CPU=`uname -m`
|
2010-04-28 09:37:38 +00:00
|
|
|
VERSION=`grep SoftwareVersion installers/autopackage/default.x86.apspec|cut -d ' ' -f 2`
|
2006-03-10 22:49:07 +00:00
|
|
|
DESTINATION=$1
|
|
|
|
TREEROOT=`pwd`
|
|
|
|
|
|
|
|
if [ "$DESTINATION" == "" ]
|
|
|
|
then
|
|
|
|
echo "Usage: tools/mknightly <destination>"
|
|
|
|
exit 255
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$VERSION" == "" ]
|
|
|
|
then
|
|
|
|
echo "I can't find the apspec file. This script needs to be run from"
|
|
|
|
echo "the repository top level directory to find all it needs."
|
|
|
|
exit 255
|
|
|
|
fi
|
|
|
|
|
|
|
|
svn up >/dev/null
|
2006-03-13 19:10:24 +00:00
|
|
|
if [ $? != 0 ]
|
|
|
|
then
|
|
|
|
echo "Nightly build could not svn up"
|
|
|
|
exit 255
|
|
|
|
fi
|
2006-03-10 22:49:07 +00:00
|
|
|
|
|
|
|
# check whether we should even bother building
|
|
|
|
LASTBUILD=`cat LASTBUILD`
|
|
|
|
THISBUILD=`svn info . | grep Revision | cut -d ' ' -f 2`
|
2006-03-13 19:10:24 +00:00
|
|
|
if [ $? != 0 ]
|
|
|
|
then
|
|
|
|
echo "Could not get build revision"
|
|
|
|
exit 255
|
|
|
|
fi
|
|
|
|
|
2006-03-10 22:49:07 +00:00
|
|
|
if [ "$LASTBUILD" == "$THISBUILD" ]
|
|
|
|
then
|
2006-03-13 19:10:24 +00:00
|
|
|
echo "Nightly build up to date - lastbuild=$LASTBUILD thisbuild=$THISBUILD"
|
2006-03-10 22:49:07 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2006-03-10 22:59:37 +00:00
|
|
|
if [ "$CPU" == 'i686' ]
|
2006-03-10 22:49:07 +00:00
|
|
|
then
|
|
|
|
CPU="x86"
|
|
|
|
fi
|
|
|
|
DEPSDIR="$TREEROOT/deps/$OS-$CPU-deps"
|
|
|
|
|
|
|
|
if [ ! -d $DEPSDIR ]
|
|
|
|
then
|
|
|
|
echo "Dependencies directory $DEPSDIR not found"
|
|
|
|
exit 255
|
|
|
|
fi
|
|
|
|
|
|
|
|
make > make.out 2> make.error
|
|
|
|
if [ $? != 0 ]
|
|
|
|
then
|
2006-03-10 23:36:34 +00:00
|
|
|
echo "Oolite mknightly died."
|
2006-03-10 22:49:07 +00:00
|
|
|
exit $?
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo $THISBUILD > LASTBUILD
|
|
|
|
svn log > $DESTINATION/changelog.txt
|
|
|
|
cp -rf oolite.app $DESTINATION
|
|
|
|
cd $DEPSDIR
|
|
|
|
cp -rf oolite-deps $DESTINATION
|
|
|
|
find $DESTINATION -name .svn -exec rm -rf {} \; 2>/dev/null
|
|
|
|
cd $DESTINATION
|
|
|
|
echo $VERSION-$THISBUILD > release.txt
|
|
|
|
echo "Oolite-$OS $CPU (`whoami`@`uname -n`) SVN revision $THISBUILD" \
|
|
|
|
> buildinfo.txt
|
|
|
|
echo "Build date: `date`" >> buildinfo.txt
|
2006-03-10 23:36:34 +00:00
|
|
|
echo "Nightly build complete for Oolite-$OS version $VERSION-$THISBUILD"
|
2006-03-10 22:49:07 +00:00
|
|
|
|