From bedbab95949b07db452d7073a8c0cdacd6db26ad Mon Sep 17 00:00:00 2001
From: Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com>
Date: Fri, 11 Jul 2014 21:54:30 +0200
Subject: [PATCH] build-system: Make it easier to run the build script locally

refs #51162

Change-Id: I28e04cfa5101bab1ced5af30f2f66765fe789708
---
 .../launch-build-machine-jenkins.sh           | 25 +++++++++++++++++++
 tools/build-system/setenv.sh                  |  7 +++++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/tools/build-system/launch-build-machine-jenkins.sh b/tools/build-system/launch-build-machine-jenkins.sh
index b6d1ec7cc1..8d300a3ade 100755
--- a/tools/build-system/launch-build-machine-jenkins.sh
+++ b/tools/build-system/launch-build-machine-jenkins.sh
@@ -12,6 +12,30 @@
 
 set -x
 
+#Check dependencies
+
+# Download the KDE client release script
+if  ! command -v curl ; then
+   echo Please install curl
+   exit 1
+fi
+# Merge the KDE translation files
+if  ! command -v ruby ; then
+   echo Please install ruby
+   exit 1
+fi
+# Download the KDE client and scripts
+if  ! command -v git ; then
+   echo Please install git
+   exit 1
+fi
+# Fetch KDE translations, the gnome client use bzr
+if  ! command -v svn ; then
+   echo Please install svn
+   exit 1
+fi
+
+
 . `dirname $0`/setenv.sh
 
 IS_RELEASE=
@@ -32,6 +56,7 @@ echo "    | SFLPhone build system |"
 echo "    \\***********************/"
 echo
 
+
 for PARAMETER in $*
 do
         case ${PARAMETER} in
diff --git a/tools/build-system/setenv.sh b/tools/build-system/setenv.sh
index 82ab389dfb..36287743b6 100755
--- a/tools/build-system/setenv.sh
+++ b/tools/build-system/setenv.sh
@@ -21,6 +21,11 @@ export EDITOR="echo"
 
 export REFERENCE_REPOSITORY="${WORKSPACE}"
 
+# In case the script is executed manually, replace the variables set by Jenkins
+if [ "${WORKSPACE}" == "" ]; then
+   WORKSPACE="."
+fi
+
 export WORKING_DIR="${WORKSPACE}/tools/build-system"
 export LAUNCHPAD_DIR="${WORKING_DIR}/launchpad"
 LAUNCHPAD_DISTRIBUTIONS=("quantal" "saucy" "trusty")
@@ -31,7 +36,7 @@ cd ${WORKSPACE}
 rm -rf config.ini
 rm -rf kde
 curl https://projects.kde.org/projects/playground/network/sflphone-kde/repository/revisions/master/raw/data/config.ini > config.ini
-git clone git://anongit.kde.org/kde-dev-scripts
+git clone http://anongit.kde.org/kde-dev-scripts
 ruby kde-dev-scripts/createtarball/create_tarball.rb -n -a sflphone-kde
 rm -rf kde-dev-scripts
 tar -xpvf sflphone-kde-*.tar.*
-- 
GitLab