From 63640df64f013097bcb41ea04b4a8a609f73b18b Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.anjos@idiap.ch>
Date: Tue, 17 Jan 2017 12:31:45 +0100
Subject: [PATCH] Set CONDA_FOLDER and BOB_PREFIX_PATH before sourcing
 functions.sh

---
 build.sh | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/build.sh b/build.sh
index cda77d6..e6f3295 100755
--- a/build.sh
+++ b/build.sh
@@ -41,6 +41,14 @@ DOCPASS="${PYPIUSER:-unknown}"
 #GITLAB_CHECKOUT_STRATEGY="https://gitlab-ci-token:${CI_BUILD_TOKEN}@gitlab.idiap.ch/"
 GITLAB_CHECKOUT_STRATEGY="git@gitlab.idiap.ch:"
 
+if [ -n "$3" ]; then
+  CONDA_FOLDER=$3;
+fi
+
+if [ -n "$4" ]; then
+  BOB_PREFIX_PATH=${CONDA_FOLDER}/envs/$4;
+fi
+
 # Source useful functions
 source ${basedir}/_ci/functions.sh
 
@@ -49,13 +57,7 @@ check_env CI_PROJECT_URL
 
 # Overrides some stuff
 if [ "${CI_BUILD_REF_NAME}" == "@local" ]; then
-  log_info "Overwriting CONDA_FOLDER since in @local build..."
-  if [ -n "$3" ]; then CONDA_FOLDER=$3; fi
-  if [ -n "$4" ]; then BOB_PREFIX_PATH=${CONDA_FOLDER}/envs/$4; fi
-  LD_LIBRARY_PATH=${BOB_PREFIX_PATH}/lib
   export_env CONDA_FOLDER
-  export_env LD_LIBRARY_PATH
-  export_env BOB_PREFIX_PATH
 fi
 
 log_info "Exporting variables for subsequent builds..."
-- 
GitLab