From 960cf604df2a5d17e68c4b6c9a4fb9f4ca7697ef Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Wed, 19 Feb 2025 05:09:51 +0100 Subject: [PATCH] Add "via" info on modulefile json entries Signed-off-by: Xavier Delaruelle --- tcl/report.tcl.in | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tcl/report.tcl.in b/tcl/report.tcl.in index ed7b1845..2674426c 100644 --- a/tcl/report.tcl.in +++ b/tcl/report.tcl.in @@ -1467,6 +1467,7 @@ proc reportModules {search_queries header hsgrkey hstyle show_mtime show_idx\ himatcharrvrmap himatcharrvrvalmap set clean_list {} set vr_list {} + set via [getViaModuleForModulepath $header] # treat elements in specified order if any ##nagelfar ignore #2 Badly formed if statement @@ -1490,8 +1491,9 @@ proc reportModules {search_queries header hsgrkey hstyle show_mtime show_idx\ switch -- [lindex $mod_list($elt) 0] { directory { if {$json} { + ##nagelfar ignore +2 Found constant set dispsgr [formatListEltToJsonDisplay $elt type s directory\ - 1 symbols a $sym_list 1] + 1 symbols a $sym_list 1 via s $via 1] } elseif {$show_mtime} { # append / char after name to clearly indicate this is a dir lassign [formatListEltToLongDisplay $elt di / $sym_list sy {}\ @@ -1504,9 +1506,11 @@ proc reportModules {search_queries header hsgrkey hstyle show_mtime show_idx\ } modulefile - virtual { if {$json} { + ##nagelfar ignore +4 Found constant set dispsgr [formatListEltToJsonDisplay $elt type s modulefile\ 1 variants o $vr_list $report_variant symbols a $sym_list 1\ - tags a $tag_list 1 pathname s [lindex $mod_list($elt) 2] 1] + tags a $tag_list 1 pathname s [lindex $mod_list($elt) 2] 1\ + via s $via 1] } elseif {$show_mtime} { set clock_mtime [expr {[lindex $mod_list($elt) 1] ne {} ?\ [clock format [lindex $mod_list($elt) 1] -format {%Y/%m/%d\ @@ -1525,9 +1529,10 @@ proc reportModules {search_queries header hsgrkey hstyle show_mtime show_idx\ } alias { if {$json} { + ##nagelfar ignore +3 Found constant set dispsgr [formatListEltToJsonDisplay $elt type s alias 1\ symbols a $sym_list 1 tags a $tag_list 1 target s [lindex\ - $mod_list($elt) 1] 1] + $mod_list($elt) 1] 1 via s $via 1] } elseif {$show_mtime} { lassign [formatListEltToLongDisplay $elt al " -> [lindex\ $mod_list($elt) 1]" $sym_list sy {} $default_colored\ @@ -1598,8 +1603,6 @@ proc reportModules {search_queries header hsgrkey hstyle show_mtime show_idx\ displayTableHeader {*}$theader_cols } - set via [getViaModuleForModulepath $header] - # output formatted elements displayElementList $header $hsgrkey $hstyle $one_per_line $show_idx 1\ $display_list $len_list $max_len $via