From f247577818cfde9eae34c7fa877f8bf7895b6aa4 Mon Sep 17 00:00:00 2001 From: gsell Date: Wed, 11 Sep 2024 17:02:27 +0200 Subject: [PATCH] Merge branch '360-modulecmd-overlayexcludes-matches-everything-if-empty' into 'master' Resolve "modulecmd: OverlayExcludes matches everything if empty" Closes #360 See merge request Pmodules/src!367 (cherry picked from commit 99a168996fb8b6749ac13d659841ec7981960114) a86a0a7c modulecmd: bugfix in handling overlay excludes Co-authored-by: gsell --- Pmodules/modulecmd.bash.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index 94c7c95..a345d6f 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -1217,7 +1217,7 @@ get_available_modules() { # its sub-directories local mod='' # module_name/module_version while read -r mod; do - [[ "${mod}" =~ ${OverlayExcludes} ]] && continue + [[ -n ${OverlayExcludes} && "${mod}" =~ ${OverlayExcludes} ]] && continue local name="${mod%/*}" local add='no' if [[ -n "${ol}" && "${ol}" != 'none' ]]; then