File: mknightly

package info (click to toggle)
oolite 1.65-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,520 kB
  • ctags: 1,503
  • sloc: objc: 56,004; ansic: 1,201; python: 1,086; java: 267; sh: 259; perl: 259; makefile: 65; xml: 39
file content (88 lines) | stat: -rwxr-xr-x 1,952 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/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`
CPU=`uname -m`
VERSION=`grep SoftwareVersion autopackage/default.apspec|cut -d ' ' -f 2`
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 
if [ $? != 0 ]
then
   echo "Nightly build could not svn up"
   exit 255
fi

# check whether we should even bother building
LASTBUILD=`cat LASTBUILD` 
THISBUILD=`svn info . | grep Revision | cut -d ' ' -f 2`
if [ $? != 0 ]
then
   echo "Could not get build revision"
   exit 255
fi

if [ "$LASTBUILD" == "$THISBUILD" ]
then
   echo "Nightly build up to date - lastbuild=$LASTBUILD thisbuild=$THISBUILD"
   exit 0
fi

if [ "$CPU" == 'i686' ]
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
   echo "Oolite mknightly died."
   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
echo "Nightly build complete for Oolite-$OS version $VERSION-$THISBUILD"