[PATCH 2/2] testbot/UpdateTaskLogs: Delete reference reports that are not supposed to exist.

Francois Gouget fgouget at codeweavers.com
Tue Jan 28 21:01:47 CST 2020


WineRunBuild used to take a snapshot of the reference logs for all the
other tasks even if the build failed. Thus there could be reference logs
even when the matching log does not exist.
This patch ensures that 'UpdateTaskLogs --delete' still finds and
deletes those.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---

There is no need to run UpdateTaskLogs for now: it's still only needed 
in case of downgrades.

 testbot/bin/UpdateTaskLogs | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/testbot/bin/UpdateTaskLogs b/testbot/bin/UpdateTaskLogs
index 5f858dece6..93b6504422 100755
--- a/testbot/bin/UpdateTaskLogs
+++ b/testbot/bin/UpdateTaskLogs
@@ -256,11 +256,16 @@ sub ProcessTaskLogs($$$)
 
   if (($OptDelete or $OptRebuild) and !$CollectOnly)
   {
-    # Save / delete the task's reference reports
-    foreach my $ReportName (@{GetLogFileNames($TaskDir)})
+    # Save / delete the task's reference reports... all of them,
+    # even if they were not supposed to exist (e.g. failed builds).
+    my ($ErrMessage, $ReportNames, $_TaskMissions) = $Task->GetReportNames();
+    if ($ErrMessage)
+    {
+      Error "$ErrMessage\n";
+      $Rc = 1;
+    }
+    foreach my $ReportName (@$ReportNames)
     {
-      next if ($ReportName !~ /\.report$/);
-
       my $RefReportName = $Task->GetRefReportName($ReportName);
       my $RefReportPath = "$StepDir/$RefReportName";
 
-- 
2.20.1



More information about the wine-devel mailing list