mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-28 10:29:37 +02:00
modulecmd: show load hints again
This commit is contained in:
+11
-11
@@ -866,15 +866,6 @@ subcommand_load() {
|
|||||||
modulecmd \
|
modulecmd \
|
||||||
"${m}" \
|
"${m}" \
|
||||||
"${modulepath[@]}"
|
"${modulepath[@]}"
|
||||||
if [[ -z ${current_modulefile} ]]; then
|
|
||||||
local hints=''
|
|
||||||
get_load_hints hints
|
|
||||||
if [[ -z "${hints}" ]]; then
|
|
||||||
die_module_nexist "${m}"
|
|
||||||
else
|
|
||||||
die_module_unavail "${m}${hints}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
[[ ${m} == Pmodules/* ]] && [[ -n ${LOADEDMODULES} ]] && \
|
[[ ${m} == Pmodules/* ]] && [[ -n ${LOADEDMODULES} ]] && \
|
||||||
die_conflict "${m}"
|
die_conflict "${m}"
|
||||||
@@ -1298,12 +1289,13 @@ find_modulefile(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
_find_modulefile() {
|
_find_modulefile() {
|
||||||
|
ref_modulefile=''
|
||||||
local -- dir=''
|
local -- dir=''
|
||||||
for dir in "${modulepath[@]}"; do
|
for dir in "${modulepath[@]}"; do
|
||||||
test -d "${dir}" || continue
|
test -d "${dir}" || continue
|
||||||
local -i col=$((${#dir} + 2 ))
|
local -i col=$((${#dir} + 2 ))
|
||||||
local -- mod=''
|
local -- mod=''
|
||||||
|
local -a found_modules=()
|
||||||
mapfile -t found_modules \
|
mapfile -t found_modules \
|
||||||
< <(find -L "${dir}" \
|
< <(find -L "${dir}" \
|
||||||
-type f \
|
-type f \
|
||||||
@@ -1363,7 +1355,15 @@ find_modulefile(){
|
|||||||
else
|
else
|
||||||
IFS=':' read -r -a modulepath <<< "${MODULEPATH}"
|
IFS=':' read -r -a modulepath <<< "${MODULEPATH}"
|
||||||
fi
|
fi
|
||||||
_find_modulefile || die_module_unavail "${modulename}"
|
if ! _find_modulefile; then
|
||||||
|
local hints=''
|
||||||
|
get_load_hints hints
|
||||||
|
if [[ -z "${hints}" ]]; then
|
||||||
|
die_module_nexist "${modulename}"
|
||||||
|
else
|
||||||
|
die_module_unavail "${modulename}${hints}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
is_modulefile modulecmd "${ref_modulefile}" || die_not_a_modulefile "${modulename}"
|
is_modulefile modulecmd "${ref_modulefile}" || die_not_a_modulefile "${modulename}"
|
||||||
if [[ "${ref_interp}" == "${Lmod_cmd}" ]]; then
|
if [[ "${ref_interp}" == "${Lmod_cmd}" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user