]> xenbits.xensource.com Git - people/royger/osstest.git/commitdiff
sg-run-job: Logfiles: Suppress links to 0-length files
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 21 Jun 2017 12:22:17 +0000 (13:22 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 21 Jun 2017 22:32:24 +0000 (23:32 +0100)
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

index f7150a0906d3d527ded157c5503dec7d7a103479..fd8a68bcec67f542cdd2569d1ad41addc0f0b43f 100755 (executable)
@@ -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)";
         }