From: Timo Heister Date: Mon, 1 Feb 2016 14:22:57 +0000 (-0500) Subject: generate enable.sh script X-Git-Tag: v0.8.4~14^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb40024fd4636dc310d412de61564a27f6cd2291;p=candi.git 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 --- 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}