From ae43f13826042286b85f3284ffac779eccb53da4 Mon Sep 17 00:00:00 2001
From: Edward Moyse <edward.moyse@cern.ch>
Date: Mon, 10 Dec 2018 10:45:07 +0100
Subject: [PATCH] Do not modify GAUDI_ROOT if it is already set, since this can
 break certain workflows.

---
 Projects/Athena/build_env.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Projects/Athena/build_env.sh b/Projects/Athena/build_env.sh
index aa621c46963..940effa7e9d 100644
--- a/Projects/Athena/build_env.sh
+++ b/Projects/Athena/build_env.sh
@@ -62,8 +62,10 @@ env_setup() {
 
     # Point to Gaudi:
     # Get platform from the GAUDI build - we're assuming here that there's only one platform installed.
-    platform=$(cd ${BUILDDIR}/install/GAUDI/${NICOS_PROJECT_VERSION}/InstallArea/;ls)
-    export GAUDI_ROOT=${BUILDDIR}/install/GAUDI/${NICOS_PROJECT_VERSION}/InstallArea/${platform}
+    if [ -z "${GAUDI_ROOT+1}" ]; then
+        platform=$(cd ${BUILDDIR}/install/GAUDI/${NICOS_PROJECT_VERSION}/InstallArea/;ls)
+        export GAUDI_ROOT=${BUILDDIR}/install/GAUDI/${NICOS_PROJECT_VERSION}/InstallArea/${platform}
+    fi
     echo "Taking Gaudi from: ${GAUDI_ROOT}"
 
     cd $startdir
-- 
GitLab