fixes for York delivery
[wxWidgets.git] / distrib / scripts / pre-flight.sh
1 #!/bin/sh
2
3 if [ "$VERSION" = "" ]; then
4 echo "Including build-environ.cfg"
5 . scripts/build-environ.cfg
6 fi
7
8 echo "$WX_TEMP_DIR"
9
10 START_DIR="$PWD"
11 WX_WEB_DIR=$WX_TEMP_DIR/wxWebSite
12 WX_SRC_DIR=$WX_TEMP_DIR/wxWidgets
13 FTPDIR=/home/ftp/pub/CVS_HEAD/v2
14 CURDATE=`date -I`
15
16 # first, grab the latest revision with specified tag
17 if [ ! -d $WX_TEMP_DIR ]; then
18 mkdir $WX_TEMP_DIR
19 fi
20
21 cd $WX_TEMP_DIR
22
23 # just do an update if we started a build but it failed somewhere
24 if [ ! -d $WX_WEB_DIR ]; then
25 cvs -d:pserver:anoncvs:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets login
26 echo "Grabbing wxWebSite sources..."
27 cvs -d:pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets checkout wxWebSite
28 else
29 cd $WX_WEB_DIR
30 cvs update -d
31 fi
32
33 if [ ! -d $WX_SRC_DIR ]; then
34 cvs -d:pserver:anoncvs:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets login
35 echo "Grabbing wx CVS with tag $BUILD_TAG"
36 cvs -d:pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets checkout -r $BUILD_TAG wxWidgets
37 else
38 cd $WX_SRC_DIR
39 cvs update -d
40 fi
41
42 # this is where we will store the wxAll tarball we create
43 if [ ! -d $START_DIR/$DISTDIR ]; then
44 mkdir -p $START_DIR/$DISTDIR
45 fi
46
47 #re-bake the bakefiles
48 if [ $rebake = "yes" ]; then
49 cd $WX_SRC_DIR/build/bakefiles
50 bakefile_gen -d ../../distrib/scripts/Bakefiles.release.bkgen
51 fi
52
53 cd $WX_SRC_DIR
54 if [ ! -d $WX_SRC_DIR/deliver ]; then
55 mkdir $WX_SRC_DIR/deliver
56 fi
57
58 # Now generate the mega tarball with everything. We will push this to our build machines.
59
60 cd $WX_TEMP_DIR
61 export APPDIR=$WX_TEMP_DIR/wxWidgets
62 export WXWIN=$WX_TEMP_DIR/wxWidgets
63 export VERSION=$BUILD_VERSION
64 rm -rf $APPDIR/deliver/*
65
66 tar czvf $START_DIR/$DIST_DIR/wxWidgets-$BUILD_VERSION-snapshot.tar.gz $APPDIR
67
68 #export DESTDIR=$STAGING_DIR
69 cp $START_DIR/scripts/create_archives.sh $APPDIR/distrib/scripts
70 chmod +x $APPDIR/distrib/scripts/create_archives.sh
71 $APPDIR/distrib/scripts/create_archives.sh --all
72
73 # copy all the archives we created to the master machine's deliver directory
74 rm -rf $START_DIR/$DIST_DIR/*
75 cp $APPDIR/deliver/*.zip $START_DIR/$DIST_DIR
76 cp $APPDIR/deliver/*.tar.gz $START_DIR/$DIST_DIR
77 cp $APPDIR/deliver/*.tar.bz2 $START_DIR/$DIST_DIR
78
79 echo "Tarball located at: $WX_TARBALL"
80
81 if [ ! -f $WX_TARBALL ]; then
82 echo "ERROR: wxAll tarball was not created by pre-flight.sh. Build cannot continue."
83 exit 1
84 else
85 cd $START_DIR
86 #cp $WX_TARBALL $STAGING_DIR
87 #cp -r $WX_WEB_DIR $STAGING_DIR
88
89 echo "Pre-flight complete. Ready for takeoff."
90 fi
91
92 if [ "$KIND" = "daily" ]; then
93 ##delete old files and then copy new ones, add a symlink
94 find ${FTPDIR}/files -type f -name wx\* -mtime +6 | xargs rm -rf
95 cp $START_DIR/$DIST_DIR/wx* ${FTPDIR}/files
96
97 rm -f ${FTPDIR}/wx* ${FTPDIR}/MD5SUM
98 for f in `find ${FTPDIR}/files -type f -name wx\* -mmin -601` ; do
99 ln -s $f `echo $f | sed -e "s/-${CURDATE}//" | sed -e "s|/files||" `
100 done
101 else
102 ## not a daily build
103 mkdir ${FTPDIR}/
104 cp $START_DIR/$DIST_DIR/wx* ${FTPDIR}/
105 fi
106
107 md5sum ${FTPDIR}/wx* > ${FTPDIR}/MD5SUM
108
109 ## make sure updated at is really last
110 sleep 10
111 echo cvs checkout done at date -u > ${FTPDIR}/updated_at.txt
112
113 echo "Delivery complete. Flying."