Skip to content

Commit

Permalink
Removed quarantine setup from pwsh init script.
Browse files Browse the repository at this point in the history
  • Loading branch information
ACSimon33 authored and xdelaruelle committed Sep 8, 2024
1 parent 7e6367d commit 0eb7f7f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 26 deletions.
22 changes: 0 additions & 22 deletions init/pwsh.ps1.in
Original file line number Diff line number Diff line change
Expand Up @@ -125,28 +125,6 @@ if ($IsWindows) {
# enable a default modulepath directory
& envmodule use "$env:MODULESHOME/modulefiles"
} else {
# setup quarantine if defined and if not on MacOS (somewhat buggy)
if (!$IsMacOS) {
if ($env:MODULES_RUN_QUARANTINE) {
$_mlre = ''
foreach ($_mlv in $env:MODULES_RUN_QUARANTINE -split ' ') {
if ($_mlv -match '^[A-Za-z_][A-Za-z0-9_]*$') {
$_mlv_value = [System.Environment]::GetEnvironmentVariable($_mlv)
if ($_mlv_value) {
$_mlre += "`$env:__MODULES_QUAR_${_mlv}='$_mlv_value';"
}
$_mlrv = "MODULES_RUNENV_$_mlv"
$_mlrv_value = [System.Environment]::GetEnvironmentVariable($_mlrv)
$_mlre += "`$env:$_mlv='$_mlrv_value';"
}
}
if ($_mlre -ne '') {
$_mlre += "`$env:__MODULES_QUARANTINE_SET=1;"
Invoke-Expression "$_mlre"
}
}
}

# define module command and surrounding initial environment (default value
# for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files)
(& "@TCLSH@" "@libexecdir@/modulecmd.tcl" pwsh autoinit) -join "`n" | Invoke-Expression
Expand Down
24 changes: 20 additions & 4 deletions testsuite/install.00-init/070-stderrtty.exp
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,19 @@ foreach shell $shell_list {
}

foreach shell $othlang_list {
testall_cmd_re "$shell" "--version" "" "Modules Release \\S+ (\\S+)" 0
switch -- $shell {
pwsh {
testall_cmd_re "$shell" "--version" "Modules Release \\S+ (\\S+)" "" 0
testall_cmd "$shell" "use,$contrib_modpath:purge:load,null:list,-t" "$cur_loaded\nnull" "" 0
testall_cmd "$shell" "use,$contrib_modpath:purge:load,null:unload,null:list,-t" "$no_loaded" "" 0
}
default {
testall_cmd_re "$shell" "--version" "" "Modules Release \\S+ (\\S+)" 0
testall_cmd "$shell" "use,$contrib_modpath:purge:load,null:list,-t" "" "$cur_loaded\nnull" 0
testall_cmd "$shell" "use,$contrib_modpath:purge:load,null:unload,null:list,-t" "" "$no_loaded" 0
}
}
testall_cmd_re "$shell" "foo" "" "$bad_cmd_re\n$type_help.*" 1
testall_cmd "$shell" "use,$contrib_modpath:purge:load,null:list,-t" "" "$cur_loaded\nnull" 0
testall_cmd "$shell" "use,$contrib_modpath:purge:load,null:unload,null:list,-t" "" "$no_loaded" 0
switch -- $shell {
cmake - r {
testall_cmd_re "$shell" "is-loaded,unk" "" ".*" 1
Expand Down Expand Up @@ -130,7 +139,14 @@ foreach shell $shell_list {
}

foreach shell $othlang_list {
testall_cmd_re "$shell" "--version" "" "Modules Release \\S+ (\\S+)" 0
switch -- $shell {
pwsh {
testall_cmd_re "$shell" "--version" "Modules Release \\S+ (\\S+)" "" 0
}
default {
testall_cmd_re "$shell" "--version" "" "Modules Release \\S+ (\\S+)" 0
}
}
}


Expand Down

0 comments on commit 0eb7f7f

Please sign in to comment.