Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f008973
Merge variant report branches of getVariantList
xdelaruelle Nov 28, 2026
e7f2e09
Merge .modulerc and .version handling when walking modulepath
xdelaruelle Nov 28, 2026
60e38da
Share code between display and test sub-commands
xdelaruelle Nov 28, 2026
d925ca2
Simplify argument check of restore and saveshow sub-commands
xdelaruelle Nov 28, 2026
98e14d9
Merge bash and bash-eval setup in execShAndGetEnv
xdelaruelle Nov 28, 2026
8a1aed3
Handle regular and NPO dependency structures with same code
xdelaruelle Nov 29, 2026
69eaba3
Share sub-interpreter setup between evaluation kinds
xdelaruelle Nov 29, 2026
b9550bc
Share option parsing of module-forbid, module-hide and module-warn
xdelaruelle Nov 29, 2026
8360d58
Evaluate modules on help sub-command like on display and test
xdelaruelle Nov 29, 2026
8299a9c
Render true and false values with same procedure
xdelaruelle Nov 29, 2026
076ee43
Render X resource set and unset with same procedure
xdelaruelle Nov 29, 2026
5557e38
Unset loaded module properties without testing their existence
xdelaruelle Nov 29, 2026
9c1eec0
Build loaded module and variant designation in one statement
xdelaruelle Nov 29, 2026
5558f1b
Test other variant of module is loaded or loading with same code
xdelaruelle Nov 29, 2026
adf80e6
Remove unused argument of tag matching procedure
xdelaruelle Nov 29, 2026
355ba32
Cache tags and extra tags of loaded modules with same code
xdelaruelle Nov 29, 2026
78f9739
Read initial environment like other collections
xdelaruelle Nov 29, 2026
3ed173a
Simplify argument parsing of getenv and getvariant commands
xdelaruelle Nov 29, 2026
8a7e6c9
Select puts channel with same code whether newline is asked or not
xdelaruelle Nov 29, 2026
2af9a36
Merge identical arms of module-info command
xdelaruelle Nov 29, 2026
f4b93fd
Share env var declaration code of whatis and scan modes
xdelaruelle Nov 29, 2026
adefa04
Reuse list difference test to check module is unloadable
xdelaruelle Nov 29, 2026
38c37fc
Pad message lines with join rather loops
xdelaruelle Nov 29, 2026
8a6ea66
Set linter message properties in one statement
xdelaruelle Nov 29, 2026
226cb0f
Merge modulefile and virtual arms of search sub-command
xdelaruelle Nov 29, 2026
176b950
Clear match caches without testing their existence
xdelaruelle Nov 29, 2026
7607671
Share code of procedures selecting alternative definitions
xdelaruelle Nov 29, 2026
7a8d3e0
Merge -a and --all option arms on command-line parsing
xdelaruelle Nov 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 4 additions & 20 deletions tcl/cache.tcl.in
Original file line number Diff line number Diff line change
Expand Up @@ -272,26 +272,10 @@ proc execute-cachefile {cachefile modpath} {
set itrp __cachefile

reportTrace '$cachefile' {Evaluate cache file}
# create cachefile interpreter at first interpretation
if {![interp exists $itrp]} {
createInterp $itrp

# dump initial interpreter state to restore it before each cachefile
# interpretation.
dumpInterpState $itrp g_cachefileVars g_cachefileArrayVars\
g_cachefileUntrackVars g_cachefileProcs

# interp has just been created
set fresh 1
} else {
set fresh 0
}

# reset interp state command before each interpretation
resetInterpState $itrp $fresh g_cachefileVars g_cachefileArrayVars\
g_cachefileUntrackVars g_cachefileProcs g_cachefileAliases\
g_cachefileAliasesPassArg g_cachefileAliasesTraces\
g_cachefileRenameCmds g_cachefileCommands
# create cachefile interpreter at first interpretation and reset its state
# before each interpretation
setupInterp $itrp g_cachefile g_cachefileAliases\
g_cachefileAliasesPassArg g_cachefileAliasesTraces g_cachefileCommands

# reset modulefile-specific variable before each interpretation
interp eval $itrp set ::ModulesCurrentCachefile "{$cachefile}"
Expand Down
31 changes: 15 additions & 16 deletions tcl/coll.tcl.in
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,26 @@ proc formatCollectionContent {path_list mod_list tag_arrser header {sgr 0}} {

# read given collection file and return the path and module lists it defines
proc readCollectionContent {collfile colldesc} {
# read specific __init__ collection from __MODULES_LMINIT env var
if {$collfile eq {__init__}} {
return [parseCollectionContent [getEnvLoadedModulePropertyParsedList\
init]]
}

# read file
if {[catch {
set fdata [split [readFile $collfile] \n]
} errMsg ]} {
reportErrorAndExit "Collection $colldesc cannot be read.\n$errMsg"
}

return [parseCollectionContent $fdata]
# collection should at least define a path or a mod, but initial env may be
# totally empty
set content [parseCollectionContent $fdata]
if {![llength [lindex $content 0]] && ![llength [lindex $content 1]]} {
reportErrorAndExit "$colldesc is not a valid collection"
}
return $content
}

proc parseCollectionContent {fdata} {
Expand Down Expand Up @@ -335,14 +347,8 @@ proc parseCollectionContent {fdata} {
# return specified collection content and differences compared to currently
# defined environment
proc getDiffBetweenCurEnvAndColl {collfile colldesc} {
# read specific __init__ collection from __MODULES_LMINIT env var
if {$collfile eq {__init__}} {
lassign [parseCollectionContent [getEnvLoadedModulePropertyParsedList\
init]] coll_path_list coll_mod_list coll_tag_arrser
} else {
lassign [readCollectionContent $collfile $colldesc] coll_path_list\
coll_mod_list coll_tag_arrser
}
lassign [readCollectionContent $collfile $colldesc] coll_path_list\
coll_mod_list coll_tag_arrser

# build list of module tagged auto-loaded in collection
array set coll_tag_arr $coll_tag_arrser
Expand All @@ -353,13 +359,6 @@ proc getDiffBetweenCurEnvAndColl {collfile colldesc} {
}
}

# collection should at least define a path or a mod, but initial env may be
# totally empty
if {$collfile ne {__init__} && ![llength $coll_path_list] && ![llength\
$coll_mod_list]} {
reportErrorAndExit "$colldesc is not a valid collection"
}

# fetch what is currently loaded
set curr_path_list [getModulePathList returnempty 0]
# get current loaded module list
Expand Down
Loading
Loading