From 8f0cda92495199f9a6e2e334addb3c8f1d6575ed Mon Sep 17 00:00:00 2001
From: Fabrice Le Goff <fabrice.le.goff@cern.ch>
Date: Tue, 3 Nov 2020 18:36:52 +0100
Subject: [PATCH] fix scripts_setup.sh

---
 script_setup.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/script_setup.sh b/script_setup.sh
index 6696415..648a358 100755
--- a/script_setup.sh
+++ b/script_setup.sh
@@ -1,6 +1,10 @@
 #!/bin/bash
 if grep -i centos /etc/redhat-release &>/dev/null; then
 	TDAQ_RELEASE=tdaq-09-02-01
+
+	echo "setting up environment for centos, tdaq release: $TDAQ_RELEASE"
+	source /sw/tdaq/setup/setup_$TDAQ_RELEASE.sh
+
 	# take the latest version of XROOTD available for this TDAQ release
 	XROOTD_VERSION=`ls $LCG_INST_PATH/$TDAQ_LCG_RELEASE/xrootd/ | \
 			awk -F. 'BEGIN{max=0; dir="NULL"} {ver = $1*10000 + $2 * 100 + $3;\
@@ -9,9 +13,7 @@ if grep -i centos /etc/redhat-release &>/dev/null; then
 		echo "error: could not find xrootd version"
 		return 1
 	fi
-
-	echo "setting up environment for centos, tdaq release: $TDAQ_RELEASE, xrootd version: $XROOTD_VERSION"
-	source /sw/tdaq/setup/setup_$TDAQ_RELEASE.sh
+	echo "found xrootd version: $XROOTD_VERSION"
 
 	# Add path for xrdcp binary matching this release
 	export PATH="$LCG_INST_PATH/$TDAQ_LCG_RELEASE/xrootd/$XROOTD_VERSION/$CMTCONFIG/bin/:$PATH"
-- 
GitLab