pre-flight.sh 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. #!/bin/sh
  2. if [ "$VERSION" = "" ]; then
  3. echo "Including build-environ.cfg"
  4. . `dirname $0`/build-environ.cfg
  5. fi
  6. # first, grab the latest revision with specified tag
  7. if [ ! -d $WX_TEMP_DIR ]; then
  8. mkdir $WX_TEMP_DIR
  9. fi
  10. # just do an update if we started a build but it failed somewhere
  11. if [ ! -d $WX_WEB_DIR ]; then
  12. cd $WX_TEMP_DIR
  13. echo "Grabbing wxWebSite sources..."
  14. svn co https://svn.wxwidgets.org/svn/wxWebSite/trunk wxWebSite
  15. else
  16. cd $WX_WEB_DIR
  17. svn cleanup
  18. svn up
  19. fi
  20. if [ ! -d $WX_SRC_DIR ]; then
  21. cd $WX_TEMP_DIR
  22. echo "Grabbing wx CVS with tag $BUILD_TAG"
  23. svn co https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk/ wxWidgets
  24. cd $WX_SRC_DIR
  25. else
  26. cd $WX_SRC_DIR
  27. svn cleanup
  28. svn up
  29. fi
  30. # this is where we will store the wxAll tarball we create
  31. if [ ! -d $DIST_DIR ]; then
  32. mkdir -p $DIST_DIR
  33. fi
  34. echo saving to $DIST_DIR
  35. #re-bake the bakefiles
  36. if [ $rebake = "yes" ]; then
  37. if [ ! -d $WX_SRC_DIR/build/bakefiles ]; then
  38. mkdir $WX_SRC_DIR/build/bakefiles
  39. fi
  40. cd $WX_SRC_DIR/build/bakefiles
  41. # always rebuild the bakefiles to avoid conflicts with cvs
  42. ## better to not use unix2dos on the wxWidgets tree so we don't get the conflicts
  43. ##fix this -B gave an option not recognised error (sf bug 1537221)...
  44. rm .ba*
  45. bakefile_gen -d ../../distrib/scripts/Bakefiles.release.bkgen
  46. fi
  47. # Now generate the mega tarball with everything. We will push this to our build machines.
  48. cd $WX_TEMP_DIR
  49. export APPDIR=$WX_TEMP_DIR/wxWidgets
  50. export WXWIN=$WX_TEMP_DIR/wxWidgets
  51. export VERSION=$BUILD_VERSION
  52. export SCRIPTDIR=${SCRIPTDIR}
  53. export DIST_DIR=${DIST_DIR}
  54. #remove old files
  55. rm -rf $APPDIR/deliver/*
  56. rm -rf $DIST_DIR/*
  57. tar czf $DIST_DIR/wxWidgets-snapshot-$BUILD_VERSION.tar.gz $WX_TEMP_DIR
  58. cp $SCRIPTDIR/create_archives.sh $APPDIR/distrib/scripts
  59. chmod +x $APPDIR/distrib/scripts/create_archives.sh
  60. $APPDIR/distrib/scripts/create_archives.sh --wxall --wxmsw
  61. echo "Tarballs located at: $DIST_DIR"
  62. if [ ! -f $WX_TARBALL ]; then
  63. echo "ERROR: wxAll tarball was not created by pre-flight.sh. Build cannot continue."
  64. exit 1
  65. else
  66. cd $DIST_DIR
  67. #cp $WX_TARBALL $STAGING_DIR
  68. #cp -r $WX_WEB_DIR $STAGING_DIR
  69. echo "Pre-flight complete. Ready for takeoff."
  70. fi
  71. if [ "$KIND" = "daily" ]; then
  72. ##delete old files and then copy new ones, add a symlink
  73. find ${FTPDIR}/files -type f -name wx\* -mtime +6 | xargs rm -rf
  74. cp $DIST_DIR/wx* ${FTPDIR}/files
  75. rm -f ${FTPDIR}/wx* ${FTPDIR}/MD5SUM
  76. for f in `find ${FTPDIR}/files -type f -name wx\* -mmin -601` ; do
  77. ln -s $f `echo $f | sed -e "s/-${CURDATE}//" | sed -e "s|/files||" `
  78. done
  79. else
  80. ## not a daily build
  81. ##get install.txt files etc
  82. ##.../docs/plat/install.txt goes to install-plat-2.7.0.txt
  83. ## wince has a file down one dir
  84. cp ${DOCDIR}/changes.txt $DIST_DIR/changes-${BUILD_VERSION}.txt
  85. for f in `find ${DOCDIR} -name install.txt` ; do
  86. cp $f $DIST_DIR/install-`echo $f | sed -e "s|${DOCDIR}||g" | sed -e "s|/install.txt||g"`-${BUILD_VERSION}.txt
  87. done
  88. for g in `find ${DOCDIR} -name readme.txt` ; do
  89. cp $g $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
  90. done
  91. # Rename double readme
  92. mv $DIST_DIR/readme-readme.txt-${BUILD_VERSION}.txt $DIST_DIR/readme-${BUILD_VERSION}.txt
  93. ## copy files ...
  94. mkdir ${FTPDIR}/
  95. cp $DIST_DIR/* ${FTPDIR}/
  96. fi
  97. md5sum ${FTPDIR}/wx* > ${FTPDIR}/MD5SUM
  98. ## make sure updated at is really last
  99. sleep 10
  100. echo svn checkout done at `date -u` > ${FTPDIR}/updated_at.txt
  101. echo "Delivery complete. Flying."