From: Olivier Berger Date: Wed, 9 Feb 2011 12:16:43 +0000 (+0000) Subject: Addding script to setup environment X-Git-Tag: v5.1~414 X-Git-Url: https://scm.fusionforge.org/anonscm/gitweb?p=fusionforge%2Ffusionforge.git;a=commitdiff_plain;h=b200fc9122cbb31d1ffd6b1e9599e5be79f5f0dd Addding script to setup environment --- diff --git a/.gitattributes b/.gitattributes index 45080d1..165bb21 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4787,6 +4787,7 @@ tests/unit/utils/TextSanitizerTest.php -text tests/unit/utils/UtilsTest.php -text tools/VM-scripts/README.txt -text tools/VM-scripts/build.sh -text +tools/VM-scripts/configure-scripts.sh -text tools/VM-scripts/install-gui.sh -text tools/VM-scripts/install.sh -text tools/VM-scripts/run-testsuite.sh -text diff --git a/tools/VM-scripts/configure-scripts.sh b/tools/VM-scripts/configure-scripts.sh new file mode 100644 index 0000000..41d9cf6 --- /dev/null +++ b/tools/VM-scripts/configure-scripts.sh @@ -0,0 +1,65 @@ +#! /bin/sh + +# Author : Olivier BERGER + +# This script will checkout the needed branch and will setup the +# scripts symlink to give the correct up-to-date scripts versions to +# the user + +if [ $# -ne 1 ]; then + echo "Please provide branch name to work on (Branch_5_1|trunk)" + exit 1 +fi + +cd $HOME + +if [ -f ./fusionforge ]; then + if [ ! -L ./fusionforge ]; then + echo "You have an existing ./fusionforge file or directory. Stopping." + exit 1 + fi +fi + +BRANCH="$1" + +if [ "$BRANCH" = "trunk" -o "$BRANCH" = "Branch_5_1" ]; then + if [ -d "./fusionforge-$BRANCH" ]; then + echo "Assuming './fusionforge-$BRANCH/' already contains a bzr checkout of the $BRANCH. Please check following output of 'bzr info' :" + (cd "./fusionforge-$BRANCH/" && bzr info) + else + if [ "$BRANCH" = "trunk" ]; then + echo "no 'fusionforge-trunk/' dir found : checking out from SVN's trunk with 'bzr checkout svn://scm.fusionforge.org/svnroot/fusionforge/trunk' :" + bzr checkout svn://scm.fusionforge.org/svnroot/fusionforge/trunk fusionforge-trunk + else + echo "no 'fusionforge-$BRANCH/' dir found : checking out from SVN's $BRANCH with 'bzr checkout svn://scm.fusionforge.org/svnroot/fusionforge/branches/$BRANCH' :" + bzr checkout "svn://scm.fusionforge.org/svnroot/fusionforge/branches/$BRANCH" "fusionforge-$BRANCH" + fi + fi +else + echo "The supplied branch : $BRANCH wasn't recognized. Maybe the script is now outdated" + exit 1 +fi + +if [ -L ./fusionforge ]; then + oldlink=$(ls -ld ./fusionforge) + echo "Removing old ./fusionforge link ($oldlink)" + rm ./fusionforge +fi + +echo "Creating a link from './fusionforge' to 'fusionforge-$BRANCH'" +ln -s "fusionforge-$BRANCH" fusionforge + +if [ -d scripts ]; then + echo "Saving old 'scripts/' dir in 'scripts.old/'." + mv scripts scripts.old +fi + +if [ -L ./scripts ]; then + oldlink=$(ls -ld ./scripts) + echo "Removing old ./scripts link ($oldlink)" + rm ./scripts +fi + +echo "Creating a link from 'fusionforge-$BRANCH/tools/VM-scripts/' to './scripts'." +ln -s "fusionforge-$BRANCH/tools/VM-scripts/" scripts +