diff mbox

[OSSTEST,15/15] sg-run-job: Logfiles: Suppress links to 0-length files

Message ID 1498054447-11281-16-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
These are not really helpful.  Making them not be links makes them
easier to skip by eye.

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

Patch

diff --git a/sg-report-flight b/sg-report-flight
index f7150a0..fd8a68b 100755
--- a/sg-report-flight
+++ b/sg-report-flight
@@ -1042,15 +1042,19 @@  END
             or $dent eq '..' or $dent eq '.' or $issteplog{$dent};
         stat("$htmldir/$job/$dent") or die "$dent $!";
 	printf H "<tr><td>%s</td>", show_abs_time((stat _)[9]);
+	my $nolink = 0;
 	if (-f _) {
 	    my $size = (stat _)[7];
 	    printf H "<td align=\"right\">&nbsp;%s</td>", $size;
+	    $nolink = !$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";
+        print H "<a href=\"".encode_entities(uri_escape($dent))."\">"
+	    unless $nolink;
+	print H encode_entities($dent).(-d _ ? "/" : "");
+	print H "</a>" unless $nolink;
         if ($dent eq 'build') {
             print H " (outputs from build)";
         }