[02/25] testbot/LogUtils: Don't rename the old logs on Engine startup.

Francois Gouget fgouget at codeweavers.com
Tue Jan 14 09:40:52 CST 2020


All the logs have been renamed by now.
---
 testbot/bin/Engine.pl               | 14 ---------
 testbot/lib/WineTestBot/LogUtils.pm | 44 -----------------------------
 2 files changed, 58 deletions(-)

diff --git a/testbot/bin/Engine.pl b/testbot/bin/Engine.pl
index aed0e51d3..49347b559 100755
--- a/testbot/bin/Engine.pl
+++ b/testbot/bin/Engine.pl
@@ -103,20 +103,6 @@ sub Cleanup($;$$)
 {
   my ($Starting, $KillTasks, $KillVMs) = @_;
 
-  # FIXME Temporary: Rename the old logs so they follow the new naming scheme
-  #       and can be identified by WineSendLog.pl and JobDetails.pl.
-  RenameReferenceLogs();
-  foreach my $Job (@{CreateJobs()->GetItems()})
-  {
-    foreach my $Step (@{$Job->Steps->GetItems()})
-    {
-      foreach my $Task (@{$Step->Tasks->GetItems()})
-      {
-        RenameTaskLogs($Task->GetDir());
-      }
-    }
-  }
-
   # Verify that the running tasks are still alive and requeue them if not.
   # Ignore the Job and Step status fields because they may be a bit out of date.
   my %RunningVMs;
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index 1b9b1bfb6..f52af6704 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -29,7 +29,6 @@ WineTestBot::LogUtils - Provides functions to parse task logs
 use Exporter 'import';
 our @EXPORT = qw(GetLogFileNames GetLogLabel GetLogErrors GetNewLogErrors
                  GetLogLineCategory GetReportLineCategory
-                 RenameReferenceLogs RenameTaskLogs
                  ParseTaskLog ParseWineTestReport);
 
 use Algorithm::Diff;
@@ -567,49 +566,6 @@ sub GetReportLineCategory($)
 # Log querying and formatting
 #
 
-sub RenameReferenceLogs()
-{
-  if (opendir(my $dh, "$DataDir/latest"))
-  {
-    # We will be renaming files so read the directory in one go
-    my @Entries = readdir($dh);
-    close($dh);
-    foreach my $Entry (@Entries)
-    {
-      if ($Entry =~ /^([a-z0-9._]+)$/)
-      {
-        my $NewName = $Entry = $1;
-        $NewName =~ s/\.log$/.report/;
-        $NewName =~ s/(_[a-z0-9]+)\.err$/$1.report.err/;
-        $NewName =~ s/_(32|64)\.report/_exe$1.report/;
-        if ($Entry ne $NewName and !-f "$DataDir/latest/$NewName")
-        {
-          rename "$DataDir/latest/$Entry", "$DataDir/latest/$NewName";
-        }
-      }
-    }
-  }
-}
-
-sub RenameTaskLogs($)
-{
-  my ($Dir) = @_;
-
-  if (-f "$Dir/err" and !-f "$Dir/log.err")
-  {
-    rename "$Dir/err", "$Dir/log.err";
-  }
-
-  if (-f "$Dir/log.old" and !-f "$Dir/old_log")
-  {
-    rename "$Dir/log.old", "$Dir/old_log";
-  }
-  if (-f "$Dir/err.old" and !-f "$Dir/old_log.err")
-  {
-    rename "$Dir/err.old", "$Dir/old_log.err";
-  }
-}
-
 =pod
 =over 12
 
-- 
2.20.1




More information about the wine-devel mailing list