From adbceb602f526ad49ddf9011ef391fd456f153ee Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 17 Nov 2023 15:43:11 +0100 Subject: [PATCH] modulecmd: blocking of modules reviewed System- and blocklist are now in the YAML module configuration file. --- Pmodules/modulecmd.bash.in | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index 0aeaf8a..8593f52 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -656,30 +656,6 @@ subcommand_load() { g_env_must_be_saved='yes' } - is_blocked() { - : " - test whether a module is blocked or not. - - args: - $1: prefix of module - - exit codes: - 0: if blocked - 1: otherwise - " - local _prefix="$1" - test -e "${_prefix}/.blocklist" || return 1 # not blocked! - local _pattern='//' - while read line; do - _pattern+=' && !'"/${line}/" - done < "${_prefix}/.blocklist" - local out=$(awk "${_pattern}"' {print $0}' <<< "${HOSTNAME}") - [[ -z "${out}" ]] || return 1 # not blocked! - [[ -r "${_prefix}/.blockmsg" ]] || return 0 - cat "${_prefix}/.blockmsg" 1>&2 - return 0 - } - #...................................................................... local args=() local opts=() @@ -803,7 +779,6 @@ subcommand_load() { die_not_a_modulefile "${m}" local prefix='' get_module_prefix prefix "${current_modulefile}" - is_blocked "${prefix}" && die_is_blocked "${m}" if [[ -n ${prefix} ]]; then test -r "${prefix}/.info" && cat "$_" 1>&2 test -r "${prefix}/.dependencies" && load_dependencies "$_"