Commit f265261a authored by stadler_h's avatar stadler_h
Browse files

- Filter out .release files

- Exit with correct return value in non library mode
parent 23c5586a
...@@ -173,11 +173,13 @@ function preselect() { # "$1": prefix for preselected modules ...@@ -173,11 +173,13 @@ function preselect() { # "$1": prefix for preselected modules
[[ -z "$1" ]] && return [[ -z "$1" ]] && return
local -a mpc # module path components local -a mpc # module path components
local -i i local -i i
local uid local uid n
pushd "$1/$PSI_MODULES_ROOT" > /dev/null || exit 1; pushd "$1/$PSI_MODULES_ROOT" > /dev/null || exit 1;
trap "popd" EXIT trap "popd" EXIT
for m in $(find . -follow -type f); do for m in $(find . -follow -type f); do
n=${m##*/}
[[ "${n:0:1}" == "." ]] && continue
uid="" uid=""
mpc=( ${m//\// } ) mpc=( ${m//\// } )
for ((i=2; i<${#mpc[@]}-2; i+=2)); do for ((i=2; i<${#mpc[@]}-2; i+=2)); do
...@@ -343,7 +345,9 @@ function module_picker() { ...@@ -343,7 +345,9 @@ function module_picker() {
[[ ${DIALOG_LIB:+"is_lib"} == "is_lib" ]] || { [[ ${DIALOG_LIB:+"is_lib"} == "is_lib" ]] || {
if [[ -x ${PMODULES_HOME}/bin/modulecmd ]]; then if [[ -x ${PMODULES_HOME}/bin/modulecmd ]]; then
module_picker "${1:-$PSI_PREFIX}" "${2:-/afs/psi.ch/sys/psi.x86_64_slp6}" module_picker "${1:-$PSI_PREFIX}" "${2:-/afs/psi.ch/sys/psi.x86_64_slp6}"
exit $?
else else
echo "ERROR: module environment configuration: ${PMODULES_HOME}/bin/modulecmd is not an executable!" echo "ERROR: module environment configuration: ${PMODULES_HOME}/bin/modulecmd is not an executable!"
exit 1
fi fi
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment