]> https://gitweb.dealii.org/ - candi.git/commitdiff
generate enable.sh script
authorTimo Heister <timo.heister@gmail.com>
Mon, 1 Feb 2016 14:22:57 +0000 (09:22 -0500)
committerTimo Heister <timo.heister@gmail.com>
Mon, 1 Feb 2016 14:24:55 +0000 (09:24 -0500)
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

index 3e01303934a3b8ff2431530b4b6fc206381fc4a9..1d2942dbe4366db773ed2f8acd9e54a39df360b4 100755 (executable)
--- 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}

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.