lib/libem.bash: bugfix in building dependencies; remove source directory in em.cleanup_src()

This commit is contained in:
2014-04-28 09:05:01 +02:00
parent d87afe6b9f
commit c960e2d7ff

View File

@@ -1,5 +1,7 @@
#!/bin/bash
declare -rx ARGS="$@"
declare -rx SHLIBDIR=$( cd $(dirname "$BASH_SOURCE") && pwd )
declare -r OS=$(uname -s)
@@ -184,8 +186,8 @@ function _load_build_dependencies() {
fi
if module load "$m" 2>&1 | grep -q "Unable to locate"; then
echo "Module \"$m\" not available, trying to build it..."
"${SCRIPTDIR}/${m/\/*}"
if -z $(module avail "$m" 2>&1); then
"${SCRIPTDIR}/${m/\/*}.build" ${ARGS[@]}
if [[ -z $(module avail "$m" 2>&1) ]]; then
echo "Oops: Building module \"$m\" failed..."
exit 1
fi
@@ -390,6 +392,8 @@ function em.cleanup_src() {
if [[ $(pwd) != / ]]; then
echo "Cleaning up $(pwd)"
rm -rf *
cd ..
rmdir "/${EM_SRCDIR}"
fi
);
}