#!/bin/bash echo "CHECKING OUT $1" echo svn checkout file://$SVNROOT/rool/$1/trunk temp/$1 sleep 2 echo echo "REMOVING CONTROL DIRECTORIES" find temp/$1 -name ".svn" -print0 | xargs -n1 -0 rm -rf $1 sleep 2 echo "PACKAGING SOURCES" cd temp tar -c -f $1.tar $1 bzip2 --best $1.tar cd .. sleep 2 echo "EXPORTING TO PUBLIC FOLDER (and tidying up)" # The rather gnarly looking ${1##*\/} strips off the longest # match from the front of the string (the '##' part means this) # with the match regexp being '*\/', i.e. any character then # (an escaped) forwards slash. Basically, it means we get the # leafname of the tar.bz2 file so it can be moved successfully. mv temp/$1.tar.bz2 ~/shared/tarballs/svn/${1##*\/}.tar.bz2 rm -rf temp sleep 2 echo "ALL DONE!" echo