#!/bin/sh # This script is for building upgrade tar files, e.g. contain all the files # needed to upgrade a 1.2.5 installation to a 1.2.6 installation. The # wizard is not included, since this script is only for minor upgrades # where to find the svn repository SVNSERVER="http://devel.lifetype.net" SVNREPO="/svn/plog/plog" # check paramters if [ $# -ne 2 ]; then echo "Creates a folder with the folders that were added or updated when comparing" echo "two subversion folders or branches" echo " " echo "Usage: $0 branch1 branch2" echo " " echo "Where branch1 and branch2 are two different branches/tags from the repository" echo " " echo "Example:" echo " " echo " $0 tags/lifetype-1.2.5 tags/lifetype-1.2.6" exit -1 fi # # array with the files that we are going to remove before # making the package... Wildcards, complete paths, whatever # can be used here # # NOTE: the exact same list is also maintained in build-svn.sh, please make sure that # changes made here also propagated to the other script # TOREMOVE="include_files release/ locale/unported/ templates/LifeType/ templates/standard-with-plugins/ templates/grey-sf/ templates/plogworld docs-devel/ class/gallery/getid3/module.archive.rar.php class/gallery/getid3/module.archive.szip.php class/gallery/getid3/module.audio-video.bink.php class/gallery/getid3/module.audio-video.matroska.php class/gallery/getid3/module.audio-video.nsv.php class/gallery/getid3/module.audio.avr.php class/gallery/getid3/module.audio.bonk.php class/gallery/getid3/module.audio.la.php class/gallery/getid3/module.audio.lpac.php class/gallery/getid3/module.audio.monkey.php class/gallery/getid3/module.audio.optimfrog.php class/gallery/getid3/module.audio.rkau.php class/gallery/getid3/module.audio.shorten.php class/gallery/getid3/module.audio.tta.php class/gallery/getid3/module.audio.voc.php class/gallery/getid3/module.audio.vqf.php class/gallery/getid3/module.graphic.bmp.php class/gallery/getid3/module.graphpc.pcd.php class/gallery/getid3/module.misc.exe.php class/gallery/getid3/module.misc.iso.php class/gallery/getid3/extension.cache.dbm.php class/gallery/getid3/extension.cache.mysql.php class/gallery/getid3/write.apetag.php class/gallery/getid3/write.id3v1.php class/gallery/getid3/write.id3v2.php class/gallery/getid3/write.lyrics3.php class/gallery/getid3/write.metaflac.php class/gallery/getid3/write.php class/gallery/getid3/write.real.php class/gallery/getid3/write.vorbiscomment.php dbperf.php *.xcode tools/ runtests.php class/test/" # parameters with the branches BRANCH1=$1 BRANCH2=$2 # create our temporary folder WORKFOLDER=`date +%Y%m%d%H%M` DESTFOLDER="destination" rm -rf $WORKFOLDER mkdir $WORKFOLDER rm -rf $DESTFOLDER mkdir $DESTFOLDER # checkout the first branch echo "Checking out $BRANCH1..." svn checkout $SVNSERVER$SVNREPO/$BRANCH1 $WORKFOLDER > /dev/null # switch to the second one pushd $WORKFOLDER > /dev/null echo "Switching to $BRANCH2..." REV=`svn switch $SVNSERVER$SVNREPO/$BRANCH2 | tee files | tail -n 1 | cut -d ' ' -f 4 | tr -d . ` popd > /dev/null # and remove all unnecessary files echo "Removing unnecessary files..."; for i in $TOREMOVE do # echo " -- removing $i" rm -rf $WORKFOLDER/$i done # remove files that shouldn't be included in upgrades rm -f $WORKFOLDER/wizard* rm -rf $WORKFOLDER/config/ echo "Generating MD5 hash of files..." php $WORKFOLDER/bin-devel/genmd5.php echo "Copying new or updated files..." # need to change this. We should parse deleted files, and parse # this list in order because the same file could have been added # and deleted within the time range we are interested in, and # the current method will cause errors. for i in `grep "^[UA]" $WORKFOLDER/files | grep -v revision | awk '{print $2}'` do if [ -f $WORKFOLDER/$i -o -d $WORKFOLDER/$i ]; then echo Keeping: $i FOLDER=`dirname $i` mkdir -p $DESTFOLDER/$FOLDER cp $WORKFOLDER/$i $DESTFOLDER/$FOLDER # else # echo Ignoring: $i fi done # finally, update the version.php file echo "Updating the version.php file..." VERNAME=`basename ${BRANCH2}` echo " $DESTFOLDER/version.php echo "\$version = \"${VERNAME}_r${REV}\";" >> $DESTFOLDER/version.php echo "?>" >> $DESTFOLDER/version.php # make sure that install/files.properties.php is included echo "Moving the updated files.properties.php to the destination package..." mkdir -p $DESTFOLDER/install cp $WORKFOLDER/install/files.properties.php $DESTFOLDER/install/files.properties.php # remove temporary folders rm -rf $WORKFOLDER # remove files that shouldn't be included in any release rm -rf $DESTFOLDER/bin-devel/ rm -rf $DESTFOLDER/docs-devel/ rm -rf $DESTFOLDER/plog.xcode/ rm -rf $DESTFOLDER/release/ rm -rf $DESTFOLDER/templates/LifeType rm -rf $DESTFOLDER/templates/grey-sf rm -rf $DESTFOLDER/templates/plogworld echo "Done! Output available under the $DESTFOLDER/ folder"