Francois Gouget : testbot/web: Make JobDetails. pl handle empty err logs correctly.

Alexandre Julliard julliard at winehq.org
Wed Mar 27 13:09:01 CDT 2013


Module: tools
Branch: master
Commit: 0c329e178170c6c489ca98198f2958b8d0c30c5c
URL:    http://source.winehq.org/git/tools.git/?a=commit;h=0c329e178170c6c489ca98198f2958b8d0c30c5c

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Wed Mar 27 16:39:45 2013 +0100

testbot/web: Make JobDetails.pl handle empty err logs correctly.

The task scripts used to create the err log and then delete it if it
was empty. However the Task module now redirects the script's stderr
to the err log to help diagnose script bugs (e.g. perl errors). That
means the script must only append to the err log and should certainly
not delete it.  So JobDetails.pl should now be able to deal with empty
err logs.

---

 testbot/web/JobDetails.pl |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl
index 11bb122..a751f11 100644
--- a/testbot/web/JobDetails.pl
+++ b/testbot/web/JobDetails.pl
@@ -410,22 +410,25 @@ sub GenerateBody
 
       if (open ERRFILE, "<$ErrName")
       {
-        if (! $First)
-        {
-          print "</code></pre>\n";
-          $First = 1;
-        }
+        $CurrentDll = "*err*";
         while (defined($Line = <ERRFILE>))
         {
           $HasLogEntries = 1;
           chomp($Line);
-          if ($First)
+          if ($PrintedDll ne $CurrentDll)
           {
-            print "<br>\n";
-            print "<pre><code>";
-            $First = !1;
+            if ($First)
+            {
+              $First = !1;
+            }
+            else
+            {
+              print "</code></pre>\n";
+            }
+            $PrintedDll = $CurrentDll;
           }
-          print $self->escapeHTML($Line), "\n";
+          print "<br>\n";
+          print "<pre><code>", $self->escapeHTML($Line), "\n";
         }
         close ERRFILE;
       }




More information about the wine-cvs mailing list