mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-28 18:29:39 +02:00
changes merged from master
This commit is contained in:
+17
-11
@@ -37,6 +37,7 @@ proc module-addgroup { group } {
|
||||
set ::${group} $name
|
||||
set ::${group}_version $version
|
||||
|
||||
debug "mode=[module-info mode]"
|
||||
if { [module-info mode load] } {
|
||||
debug "mode is load"
|
||||
foreach overlay $::PmodulesOverlays {
|
||||
@@ -73,25 +74,30 @@ proc module-addgroup { group } {
|
||||
}
|
||||
debug "mode=remove: $env(MODULEPATH)"
|
||||
foreach overlay $::PmodulesOverlays {
|
||||
remove-path MODULEPATH [file join \
|
||||
$overlay \
|
||||
$group \
|
||||
$::PmodulesModulfilesDir \
|
||||
{*}$::variant]
|
||||
set dir [file join \
|
||||
$overlay \
|
||||
$group \
|
||||
$::PmodulesModulfilesDir \
|
||||
{*}$::variant]
|
||||
remove-path MODULEPATH $dir
|
||||
}
|
||||
debug "mode=remove: $env(PMODULES_USED_GROUPS)"
|
||||
remove-path UsedGroups $group
|
||||
debug "mode=remove: $env(UsedGroups)"
|
||||
}
|
||||
if { [module-info mode switch2] } {
|
||||
debug "mode=switch2"
|
||||
foreach overlay $::PmodulesOverlays {
|
||||
append-path MODULEPATH [file join \
|
||||
$::PmodulesRoot \
|
||||
$group \
|
||||
$::PmodulesModulfilesDir \
|
||||
[module-info name]]
|
||||
set dir [file join \
|
||||
$overlay \
|
||||
$group \
|
||||
$::PmodulesModulfilesDir \
|
||||
[module-info name]]
|
||||
if { [file isdirectory $dir] } {
|
||||
append-path MODULEPATH $dir
|
||||
}
|
||||
}
|
||||
append-path UsedGroups ${group}
|
||||
debug "mode=switch2: $env(UsedGroups)"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -715,7 +715,6 @@ subcommand_load() {
|
||||
current_modulefile="${array[0]}"
|
||||
prefix="${array[1]}"
|
||||
test -n "${current_modulefile}" || return 1
|
||||
local release=''
|
||||
get_release release "${current_modulefile}" "${UsedReleases}"
|
||||
}
|
||||
|
||||
@@ -918,10 +917,30 @@ subcommand_unload() {
|
||||
# another module.
|
||||
# For the time being the modules requiring this module will be
|
||||
# unloaded too.
|
||||
local opts=()
|
||||
pmodules::get_options opts -- '' "$@" || subcommand_help_${subcommand}
|
||||
eval set -- "${opts[@]}"
|
||||
local args=()
|
||||
while (( $# > 0 )); do
|
||||
subcommand_generic1 unload "$1"
|
||||
case $1 in
|
||||
-- )
|
||||
;;
|
||||
* )
|
||||
args+=( "$1" )
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
if (( ${#args[@]} == 0 )); then
|
||||
std::die 3 "%s %s: missing argument\n" \
|
||||
"${CMD}" 'unload'
|
||||
fi
|
||||
|
||||
for arg in "${args[@]}"; do
|
||||
local output=$("${modulecmd}" "${g_shell}" "${subcommand}" "${arg}")
|
||||
echo "${output}"
|
||||
eval "${output}"
|
||||
done
|
||||
}
|
||||
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user