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
9 # This script, itself, may need to be brought up-to-date.
12 # wget "https://fusionforge.org/scm/viewvc.php/*checkout*/trunk/tools/VM-scripts/configure-scripts.sh?root=fusionforge"
13 # to get the latest version from the trunk (replace '/trunk' by
14 # '/branches/Branch_5_1' for Branch 5.1's version for instance.
18 echo "Please provide branch name to work on (Branch_5_1|trunk)"
24 if [ -f ./fusionforge ]; then
25 if [ ! -L ./fusionforge ]; then
26 echo "You have an existing ./fusionforge file or directory. Stopping."
33 if [ "$BRANCH" = "trunk" -o "$BRANCH" = "Branch_5_1" ]; then
34 if [ -d "./fusionforge-$BRANCH" ]; then
35 echo "Assuming './fusionforge-$BRANCH/' already contains a bzr checkout of the $BRANCH. Please check following output of 'bzr info' :"
36 (cd "./fusionforge-$BRANCH/" && bzr info)
38 if [ "$BRANCH" = "trunk" ]; then
39 echo "no 'fusionforge-trunk/' dir found : checking out from SVN's trunk with 'bzr checkout svn://scm.fusionforge.org/svnroot/fusionforge/trunk' :"
40 bzr checkout svn://scm.fusionforge.org/svnroot/fusionforge/trunk fusionforge-trunk
42 echo "no 'fusionforge-$BRANCH/' dir found : checking out from SVN's $BRANCH with 'bzr checkout svn://scm.fusionforge.org/svnroot/fusionforge/branches/$BRANCH' :"
43 bzr checkout "svn://scm.fusionforge.org/svnroot/fusionforge/branches/$BRANCH" "fusionforge-$BRANCH"
47 echo "The supplied branch : $BRANCH wasn't recognized. Maybe the script is now outdated"
51 if [ -L ./fusionforge ]; then
52 oldlink=$(ls -ld ./fusionforge)
53 echo "Removing old ./fusionforge link ($oldlink)"
57 echo "Creating a link from './fusionforge' to 'fusionforge-$BRANCH'"
58 ln -s "fusionforge-$BRANCH" fusionforge
60 if [ -d scripts ]; then
61 echo "Saving old 'scripts/' dir in 'scripts.old/'."
62 mv scripts scripts.old
65 if [ -L ./scripts ]; then
66 oldlink=$(ls -ld ./scripts)
67 echo "Removing old ./scripts link ($oldlink)"
71 echo "Creating a link from 'fusionforge-$BRANCH/tools/VM-scripts/' to './scripts'."
72 ln -s "fusionforge-$BRANCH/tools/VM-scripts/" scripts
74 if [ -L scripts/reload-db.sh ]; then
75 oldlink=$(ls -ld scripts/reload-db.sh)
76 echo "Removing old scripts/reload-db.sh link ($oldlink)"
77 rm scripts/reload-db.sh
80 echo "Creating a link from 'fusionforge-$BRANCH/tests/func/db_reload.sh' to 'scripts/reload-db.sh'."
81 ln -s "../../tests/func/db_reload.sh" scripts/reload-db.sh