]> git.saurik.com Git - wxWidgets.git/blob - distrib/scripts/pre-flight.sh
some more operator?! tests
[wxWidgets.git] / distrib / scripts / pre-flight.sh
1 #!/bin/sh
2
3 if [ "$VERSION" = "" ]; then
4 echo "Including build-environ.cfg"
5 . `dirname $0`/build-environ.cfg
6 fi
7
8 echo "temp dir is $WX_TEMP_DIR"
9 START_DIR="$PWD"
10 echo "start dir is $START_DIR"
11
12 SCRIPTDIR=${START_DIR}/scripts
13 WX_WEB_DIR=$WX_TEMP_DIR/wxWebSite
14 WX_SRC_DIR=$WX_TEMP_DIR/wxWidgets
15
16 CURDATE=`date -I`
17
18 # first, grab the latest revision with specified tag
19 if [ ! -d $WX_TEMP_DIR ]; then
20 mkdir $WX_TEMP_DIR
21 fi
22
23 cd $WX_TEMP_DIR
24
25 # just do an update if we started a build but it failed somewhere
26 if [ ! -d $WX_WEB_DIR ]; then
27 cvs -d:pserver:anoncvs:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets login
28 echo "Grabbing wxWebSite sources..."
29 cvs -d:pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets checkout wxWebSite
30 else
31 cd $WX_WEB_DIR
32 cvs update -d -P
33 fi
34
35 if [ ! -d $WX_SRC_DIR ]; then
36 cd $WX_TEMP_DIR
37 cvs -d:pserver:anoncvs:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets login
38 echo "Grabbing wx CVS with tag $BUILD_TAG"
39 cvs -d:pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets checkout -r $BUILD_TAG wxWidgets
40 cd $WX_SRC_DIR
41 else
42 cd $WX_SRC_DIR
43 cvs update -d -P
44 fi
45 #copy setup0.h setup.h for msw
46 rm include/wx/msw/setup.h
47 cp include/wx/msw/setup0.h include/wx/msw/setup.h
48
49 # this is where we will store the wxAll tarball we create
50 if [ ! -d $START_DIR/$DISTDIR ]; then
51 mkdir -p $START_DIR/$DISTDIR
52 fi
53
54 #re-bake the bakefiles
55 if [ $rebake = "yes" ]; then
56 if [ ! -d $WX_SRC_DIR/build/bakefiles ]; then
57 mkdir $WX_SRC_DIR/build/bakefiles
58 fi
59
60 cd $WX_SRC_DIR/build/bakefiles
61 # always rebuild the bakefiles to avoid conflicts with cvs
62 ## better to not use unix2dos on the wxWidgets tree so we don't get the conflicts
63 ##fix this -B gave an option not recognised error (sf bug 1537221)...
64 rm .ba*
65 bakefile_gen -d ../../distrib/scripts/Bakefiles.release.bkgen
66 fi
67
68 cd $WX_SRC_DIR
69 if [ ! -d $WX_SRC_DIR/deliver ]; then
70 mkdir $WX_SRC_DIR/deliver
71 fi
72
73 # Now generate the mega tarball with everything. We will push this to our build machines.
74
75 cd $WX_TEMP_DIR
76 export APPDIR=$WX_TEMP_DIR/wxWidgets
77 export WXWIN=$WX_TEMP_DIR/wxWidgets
78 export VERSION=$BUILD_VERSION
79 export SCRIPTDIR=${SCRIPTDIR}
80
81 #remove old files
82 rm -rf $APPDIR/deliver/*
83 rm -rf $START_DIR/$DIST_DIR/*
84
85
86 tar czf $START_DIR/$DIST_DIR/wxWidgets-snapshot-$BUILD_VERSION.tar.gz $WX_TEMP_DIR
87
88 #export DESTDIR=$STAGING_DIR
89 cp $SCRIPTDIR/create_archives.sh $APPDIR/distrib/scripts
90 chmod +x $APPDIR/distrib/scripts/create_archives.sh
91 $APPDIR/distrib/scripts/create_archives.sh --all
92
93 # copy all the archives we created to the master machine's deliver directory
94 cp $APPDIR/deliver/*.zip $START_DIR/$DIST_DIR
95 cp $APPDIR/deliver/*.tar.gz $START_DIR/$DIST_DIR
96 cp $APPDIR/deliver/*.tar.bz2 $START_DIR/$DIST_DIR
97
98 echo "Tarballs located at: $START_DIR/$DIST_DIR"
99
100 if [ ! -f $WX_TARBALL ]; then
101 echo "ERROR: wxAll tarball was not created by pre-flight.sh. Build cannot continue."
102 exit 1
103 else
104 cd $START_DIR
105 #cp $WX_TARBALL $STAGING_DIR
106 #cp -r $WX_WEB_DIR $STAGING_DIR
107
108 echo "Pre-flight complete. Ready for takeoff."
109 fi
110
111 if [ "$KIND" = "daily" ]; then
112 ##delete old files and then copy new ones, add a symlink
113 find ${FTPDIR}/files -type f -name wx\* -mtime +6 | xargs rm -rf
114 cp $START_DIR/$DIST_DIR/wx* ${FTPDIR}/files
115
116 rm -f ${FTPDIR}/wx* ${FTPDIR}/MD5SUM
117 for f in `find ${FTPDIR}/files -type f -name wx\* -mmin -601` ; do
118 ln -s $f `echo $f | sed -e "s/-${CURDATE}//" | sed -e "s|/files||" `
119 done
120 else
121 ## not a daily build
122 ##get install.txt files etc
123 ##.../docs/plat/install.txt goes to install-plat-2.7.0.txt
124 ## wince has a file down one dir
125 cp ${DOCDIR}/changes.txt $START_DIR/$DIST_DIR/changes-${BUILD_VERSION}.txt
126
127 for f in `find ${DOCDIR} -name install.txt` ; do
128 cp $f $START_DIR/$DIST_DIR/install-`echo $f | sed -e "s|${DOCDIR}||g" | sed -e "s|/install.txt||g"`-${BUILD_VERSION}.txt
129 done
130
131 for g in `find ${DOCDIR} -name readme.txt` ; do
132 cp $g $START_DIR/$DIST_DIR/readme-`echo $g | sed -e "s|${DOCDIR}||g" | sed -e "s|msw/wince|wince|g" | sed -e "s|/readme.txt||g"`-${BUILD_VERSION}.txt
133 done
134 # Rename double readme
135 mv $START_DIR/$DIST_DIR/readme-readme.txt-${BUILD_VERSION}.txt $START_DIR/$DIST_DIR/readme-${BUILD_VERSION}.txt
136 ## copy files ...
137 mkdir ${FTPDIR}/
138 cp $START_DIR/$DIST_DIR/* ${FTPDIR}/
139
140 fi
141
142 md5sum ${FTPDIR}/wx* > ${FTPDIR}/MD5SUM
143
144 ## make sure updated at is really last
145 sleep 10
146 echo cvs checkout done at `date -u` > ${FTPDIR}/updated_at.txt
147
148 echo "Delivery complete. Flying."