From cb40024fd4636dc310d412de61564a27f6cd2291 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Mon, 1 Feb 2016 09:22:57 -0500 Subject: [PATCH] generate enable.sh script This creates a little helper script in ${CONFIGURATION_PATH} that will source all configuration files. With this you can setup your whole environment (PETSC_DIR, etc.) just by calling source ${CONFIGURATION_PATH}/enable.sh --- candi.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/candi.sh b/candi.sh index 3e01303..1d2942d 100755 --- a/candi.sh +++ b/candi.sh @@ -863,6 +863,28 @@ mkdir -p ${BUILD_PATH} mkdir -p ${INSTALL_PATH} mkdir -p ${CONFIGURATION_PATH} +# configuration script +cat > ${CONFIGURATION_PATH}/enable.sh <<"EOF" +#!/bin/bash +# helper script to source all configuration files. Use +# source enable.sh +# to load into your current shell. + +# find path of script: +pushd . >/dev/null +P="${BASH_SOURCE[0]}";cd `dirname $P`;P=`pwd`; +popd >/dev/null + +for f in $P/* +do + if [ "$f" != "$P/enable.sh" ] + then + source $f + fi +done +EOF + + # Keep original variables # WARNING: do not overwrite this variables! ORIG_INSTALL_PATH=${INSTALL_PATH} -- 2.39.5