@@ -316,7 +316,7 @@ proc sortModulePerLoadedAndDepOrder {modlist {nporeq 0} {loading 0}} {
316316
317317# return list of loaded modules having an unmet requirement on passed mod
318318# and their recursive dependent
319- proc getUnmetDependentLoadedModuleList {modnamevr} {
319+ proc getUnmetDependentLoadedModuleList {modnamevr mod_file } {
320320 set unmetdeplist {}
321321 set depmodlist {}
322322 defineModEqProc [isIcase] [getConf extended_default] 1
@@ -328,7 +328,12 @@ proc getUnmetDependentLoadedModuleList {modnamevr} {
328328 if {![llength $modconlist ]} {
329329 foreach ummod [array names ::g_unmetDepHash] {
330330 if {[modEq $ummod $mod eqstart 1 2 1 $vrlist ]} {
331- foreach depmod $::g_unmetDepHash($ummod) {
331+ foreach {depmod prereq_path_list} $::g_unmetDepHash($ummod) {
332+ if {![isModulefileMatchSpecificPath $mod_file \
333+ $prereq_path_list ]} {
334+ continue
335+ }
336+
332337 lappend depmodlist $depmod
333338 # temporarily remove prereq violation of depmod if mod
334339 # load solves it (no other prereq is missing)
@@ -441,11 +446,13 @@ proc getDirectDependentList {mod {strong 0} {nporeq 0} {loading 0}\
441446 }
442447 foreach loadingmod [getLoadingModuleList] {
443448 foreach prereq [getLoadedPrereq $loadingmod ] {
449+ set prereq_path_list [getLoadedPrereqPath $loadingmod $prereq ]
444450 set lmprelist {}
445451 set moddep 0
446452 foreach modpre $prereq {
447453 foreach lmmod $modlist {
448- if {[modEq $modpre $lmmod eqstart 1 2 1]} {
454+ if {[isLoadedMatchSpecificPath $lmmod $prereq_path_list 0]\
455+ && [modEq $modpre $lmmod eqstart 1 2 1]} {
449456 lappend lmprelist $lmmod
450457 if {$lmmod eq $mod } {
451458 set moddep 1
@@ -786,8 +793,9 @@ proc savePropsOfReloadingModule {mod} {
786793 set extra_tag_list [getExtraTagList $mod ]
787794 set conflict_list [getLoadedConflict $mod ]
788795 set prereq_list [getLoadedPrereq $mod ]
796+ set prereq_path_list [getLoadedPrereqPath $mod ]
789797 set ::g_savedPropsOfReloadMod($mod ) [list $is_user_asked $vr_list \
790- $tag_list $extra_tag_list $conflict_list $prereq_list ]
798+ $tag_list $extra_tag_list $conflict_list $prereq_list $prereq_path_list ]
791799}
792800
793801proc getSavedPropsOfReloadingModule {mod} {
@@ -839,15 +847,15 @@ proc reloadModuleListLoadPhase {mod_list {errmsgtpl {}} {context load}} {
839847 setConf auto_handling 0
840848 foreach mod $mod_list {
841849 lassign [getSavedPropsOfReloadingModule $mod ] is_user_asked vr_list\
842- tag_list extra_tag_list conflict_list prereq_list
850+ tag_list extra_tag_list conflict_list prereq_list prereq_path_list
843851 # if an auto set default was excluded, module spec need parsing
844852 lassign [parseModuleSpecification 0 0 0 0 $mod {*}$vr_list ] modnamevr
845853
846854 # do not try to reload DepRe module if requirements are not satisfied
847855 # unless if sticky
848856 if {$context eq {depre} && ![isModuleLoadable $mod $modnamevr \
849- $conflict_list $prereq_list ] && ![isModuleStickyFromTagList \
850- {*}$tag_list {*}$extra_tag_list ]} {
857+ $conflict_list $prereq_list $prereq_path_list ] &&\
858+ ![isModuleStickyFromTagList {*}$tag_list {*}$extra_tag_list ]} {
851859 continue
852860 }
853861
@@ -871,7 +879,8 @@ proc reloadModuleListLoadPhase {mod_list {errmsgtpl {}} {context load}} {
871879 setConf auto_handling 1
872880}
873881
874- proc isModuleLoadable {mod mod_vr conflict_list prereq_list} {
882+ proc isModuleLoadable {mod mod_vr conflict_list prereq_list\
883+ prereq_path_list} {
875884 setLoadedConflict $mod {*}$conflict_list
876885 set is_conflicting [llength [getModuleLoadedConflict $mod ]]
877886 unsetLoadedConflict $mod
@@ -880,13 +889,20 @@ proc isModuleLoadable {mod mod_vr conflict_list prereq_list} {
880889 return 0
881890 }
882891
892+ array set prereq_path_arr $prereq_path_list
883893 foreach prereq_arg $prereq_list {
894+ if {[info exists prereq_path_arr($prereq_arg )]} {
895+ set prereq_arg_path $prereq_path_arr($prereq_arg)
896+ } else {
897+ set prereq_arg_path {}
898+ }
884899 set is_requirement_loaded 0
885900 foreach req_mod $prereq_arg {
886901 # is requirement loaded, loading or optional
887- if {[string length [getLoadedMatchingName $req_mod returnfirst 0]]\
888- || [string length [getLoadedMatchingName $req_mod returnfirst\
889- 1]] || $req_mod eq $mod } {
902+ if {[string length [getLoadedMatchingName $req_mod returnfirst 0 {}\
903+ $prereq_arg_path ]] || [string length [getLoadedMatchingName\
904+ $req_mod returnfirst 1 {} $prereq_arg_path ]] || $req_mod eq\
905+ $mod } {
890906 set is_requirement_loaded 1
891907 break
892908 }
0 commit comments