Skip to content
Snippets Groups Projects
Commit 1aa64f4d authored by Cedric Verstege's avatar Cedric Verstege
Browse files

Improve Error handling in Bootstrap file

parent fee2b79d
Branches
No related tags found
No related merge requests found
......@@ -33,6 +33,10 @@ bootstrap_htcondor_standalone() {
mkdir -p "${ANALYSIS_BASE}"
cd "${ANALYSIS_BASE}" || exit "$?"
law_wlcg_get_file "{{repo_uris}}" '{{repo_pattern}}' "${ANALYSIS_BASE}/repo.tgz" || return "$?"
if [ ! -f "repo.tgz" ]; then
echo "Repo bundle does not exist. Exiting..."
return 1
fi
tar -xzf "repo.tgz" || return "$?"
rm -f "repo.tgz"
echo "Analysis repo setup done."
......@@ -46,6 +50,10 @@ bootstrap_htcondor_standalone() {
scramv1 project CMSSW "${CMSSW_VERSION}"
cd "${CMSSW_VERSION}" || return "$?"
law_wlcg_get_file "{{cmssw_uris}}" '{{cmssw_pattern}}' "${PWD}/cmssw.tgz" || return "$?"
if [ ! -f "cmssw.tgz" ]; then
echo "CMSSW bundle does not exist. Exiting..."
return 1
fi
tar -xzf "cmssw.tgz" || return "$?"
rm -f "cmssw.tgz"
cd "src" || return "$?"
......@@ -57,7 +65,8 @@ bootstrap_htcondor_standalone() {
# source the repo setup
echo "export CMSSW_DIR=${CMSSW_BASE}/${CMSSW_VERSION}" > "$ANALYSIS_BASE/cmssw.conf"
cd "${ANALYSIS_BASE}" || return "$?"
source "${ANALYSIS_BASE}/setup.sh" "default" || return "$?"
sleep 10 # filesystem catch-up
source "${ANALYSIS_BASE}/setup.sh" || return "$?"
return "0"
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment