diff mbox

[OSSTEST,14/15] sg-report-flight: Make logfile list into table, with more info

Message ID 1498054447-11281-15-git-send-email-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ian Jackson June 21, 2017, 2:14 p.m. UTC
Also print the mtime and the size.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: New patch.
---
 sg-report-flight | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/sg-report-flight b/sg-report-flight
index b7cd03a..f7150a0 100755
--- a/sg-report-flight
+++ b/sg-report-flight
@@ -1026,7 +1026,13 @@  END
 <p>
 <h2>Logfiles etc.</h2>
 For main test script logfiles, see entries in steps table.
-<ul>
+<p>
+<table>
+<tr>
+<th>modified/fetched</th>
+<th align="right">size</th>
+<th align="left">filename</th>
+</tr>
 END
     opendir LOGS, "$htmldir/$job" or die "$htmldir/$job $!";
     my @dents= sort readdir LOGS;
@@ -1035,14 +1041,23 @@  END
         next if $dent eq "$htmlleaf.new" or $dent eq $htmlleaf
             or $dent eq '..' or $dent eq '.' or $issteplog{$dent};
         stat("$htmldir/$job/$dent") or die "$dent $!";
-        print H "<li><a href=\"".encode_entities(uri_escape($dent))."\">".
+	printf H "<tr><td>%s</td>", show_abs_time((stat _)[9]);
+	if (-f _) {
+	    my $size = (stat _)[7];
+	    printf H "<td align=\"right\">&nbsp;%s</td>", $size;
+	} else {
+	    print H "<td align=\"right\">dir</td>";
+	}
+	print H "<td>";
+        print H "<a href=\"".encode_entities(uri_escape($dent))."\">".
             encode_entities($dent).(-d _ ? "/" : "")."</a>\n";
         if ($dent eq 'build') {
             print H " (outputs from build)";
         }
+	print H "</td></tr>\n";
     }
     print H <<END;
-</ul>
+</table>
 <h2>Test control variables</h2>
 <table rules=all><tr><th>Name</th><th>Value</th><th>Source</th></tr>
 END