3 # Author : Olivier BERGER <olivier.berger@it-sudparis.eu>
5 # This script will checkout the needed branch and will setup the
6 # scripts symlink to give the correct up-to-date scripts versions to
10 echo "Please provide branch name to work on (Branch_5_1|trunk)"
16 if [ -f ./fusionforge ]; then
17 if [ ! -L ./fusionforge ]; then
18 echo "You have an existing ./fusionforge file or directory. Stopping."
25 if [ "$BRANCH" = "trunk" -o "$BRANCH" = "Branch_5_1" ]; then
26 if [ -d "./fusionforge-$BRANCH" ]; then
27 echo "Assuming './fusionforge-$BRANCH/' already contains a bzr checkout of the $BRANCH. Please check following output of 'bzr info' :"
28 (cd "./fusionforge-$BRANCH/" && bzr info)
30 if [ "$BRANCH" = "trunk" ]; then
31 echo "no 'fusionforge-trunk/' dir found : checking out from SVN's trunk with 'bzr checkout svn://scm.fusionforge.org/svnroot/fusionforge/trunk' :"
32 bzr checkout svn://scm.fusionforge.org/svnroot/fusionforge/trunk fusionforge-trunk
34 echo "no 'fusionforge-$BRANCH/' dir found : checking out from SVN's $BRANCH with 'bzr checkout svn://scm.fusionforge.org/svnroot/fusionforge/branches/$BRANCH' :"
35 bzr checkout "svn://scm.fusionforge.org/svnroot/fusionforge/branches/$BRANCH" "fusionforge-$BRANCH"
39 echo "The supplied branch : $BRANCH wasn't recognized. Maybe the script is now outdated"
43 if [ -L ./fusionforge ]; then
44 oldlink=$(ls -ld ./fusionforge)
45 echo "Removing old ./fusionforge link ($oldlink)"
49 echo "Creating a link from './fusionforge' to 'fusionforge-$BRANCH'"
50 ln -s "fusionforge-$BRANCH" fusionforge
52 if [ -d scripts ]; then
53 echo "Saving old 'scripts/' dir in 'scripts.old/'."
54 mv scripts scripts.old
57 if [ -L ./scripts ]; then
58 oldlink=$(ls -ld ./scripts)
59 echo "Removing old ./scripts link ($oldlink)"
63 echo "Creating a link from 'fusionforge-$BRANCH/tools/VM-scripts/' to './scripts'."
64 ln -s "fusionforge-$BRANCH/tools/VM-scripts/" scripts