Skip to content

Commit b1cc1bb

Browse files
committed
Record current modulepath as a state when evaluating mod
Record transmitted modulepath as a state when evaluating a modulefile. Useful for scan evaluation to record content per modulepath.
1 parent 1844469 commit b1cc1bb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tcl/mfinterp.tcl.in

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ x-resource {x-resource x-resource reportCmd nop nop
182182
}
183183

184184
proc execute-modulefile {modfile modname modnamevrvar modspec {up_namevr 1}\
185-
{fetch_tags 1}} {
185+
{fetch_tags 1} {modpath {}}} {
186186
# link to modnamevr variable name from calling ctx if content update asked
187187
if {$up_namevr} {
188188
upvar $modnamevrvar modnamevr
@@ -194,6 +194,7 @@ proc execute-modulefile {modfile modname modnamevrvar modspec {up_namevr 1}\
194194
lappendState modulename $modname
195195
lappendState modulenamevr $modnamevr
196196
lappendState specifiedname $modspec
197+
lappendState modulepath $modpath
197198
set mode [currentState mode]
198199
lappendState debug_msg_prefix\
199200
"\[#[depthState modulename]:$mode:$modname\] "
@@ -224,6 +225,7 @@ proc execute-modulefile {modfile modname modnamevrvar modspec {up_namevr 1}\
224225
reloading_supersticky] ne $modname} {
225226
# restore changed states prior raising error
226227
lpopState debug_msg_prefix
228+
lpopState modulepath
227229
lpopState specifiedname
228230
lpopState modulename
229231
lpopState modulenamevr
@@ -237,6 +239,7 @@ proc execute-modulefile {modfile modname modnamevrvar modspec {up_namevr 1}\
237239
} else {
238240
# restore changed states prior raising error
239241
lpopState debug_msg_prefix
242+
lpopState modulepath
240243
lpopState specifiedname
241244
lpopState modulename
242245
lpopState modulenamevr
@@ -463,6 +466,7 @@ proc execute-modulefile {modfile modname modnamevrvar modspec {up_namevr 1}\
463466

464467
reportDebug "exiting $modfile"
465468
lpopState debug_msg_prefix
469+
lpopState modulepath
466470
lpopState specifiedname
467471
lpopState modulename
468472
lpopState modulenamevr

0 commit comments

Comments
 (0)