[PATCH] testbot/Build: Only download TestLauncher*.exe after updates.

Francois Gouget fgouget at codeweavers.com
Thu Sep 19 08:08:36 CDT 2019


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/bin/WineRunReconfig.pl      |  9 ++++++++-
 testbot/lib/Build/Utils.pm          | 15 +++++++++++++++
 testbot/lib/WineTestBot/LogUtils.pm |  4 ++++
 3 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index 0e802e063..a2b7afedc 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -389,10 +389,11 @@ if (!defined $TA->Wait($Pid, $Task->Timeout, 60))
   }
 }
 
+my $Summary;
 Debug(Elapsed($Start), " Retrieving 'Reconfig.log'\n");
 if ($TA->GetFile("Reconfig.log", "$TaskDir/log"))
 {
-  my $Summary = ParseTaskLog("$TaskDir/log");
+  $Summary = ParseTaskLog("$TaskDir/log");
   if ($Summary->{Task} eq "ok")
   {
     # We must have gotten the full log and the build did succeed.
@@ -435,6 +436,12 @@ if ($NewStatus eq "completed")
                         "latest/wine-parentsrc.txt")
   {
     my $BaseName = basename($FileName);
+    if ($FileName !~ m~^latest/~ and !$Summary->{$BaseName} and
+        -f "$DataDir/latest/$BaseName")
+    {
+      # This file was not updated to there is no point redownloading it.
+      next;
+    }
     Debug(Elapsed($Start), " Retrieving '$TaskDir/$BaseName'\n");
     if ($TA->GetFile($FileName, "$TaskDir/$BaseName"))
     {
diff --git a/testbot/lib/Build/Utils.pm b/testbot/lib/Build/Utils.pm
index 57a5f4b1a..50d573523 100644
--- a/testbot/lib/Build/Utils.pm
+++ b/testbot/lib/Build/Utils.pm
@@ -33,6 +33,7 @@ our @EXPORT = qw(GetToolName InfoMsg LogMsg Error
                  SetupWineEnvironment RunWine CreateWinePrefix);
 
 use Digest::SHA;
+use File::Basename;
 use File::Path;
 
 use WineTestBot::Config;
@@ -237,6 +238,13 @@ sub GetTestLauncher($)
 
 sub BuildTestLauncher()
 {
+  my %Files;
+  foreach my $Bits ("32", "64")
+  {
+    $Files{"Path$Bits"} = GetTestLauncher({Build => "win$Bits"});
+    $Files{"Before$Bits"} = GetMTime($Files{"Path$Bits"});
+  }
+
   InfoMsg "\nRebuilding TestLauncher\n";
   my $CPUCount = GetCPUCount();
   system("cd '$::RootDir/src/TestLauncher' && set -x && ".
@@ -247,6 +255,13 @@ sub BuildTestLauncher()
     return !1;
   }
 
+  foreach my $Bits ("32", "64")
+  {
+    if ($Files{"Before$Bits"} != GetMTime($Files{"Path$Bits"}))
+    {
+      LogMsg "Updated ". basename($Files{"Path$Bits"}) ."\n";
+    }
+  }
   return 1;
 }
 
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index a18c4637b..3b1c35658 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -107,6 +107,10 @@ sub ParseTaskLog($)
         $Summary->{Task} = "badpatch";
         last; # Should be the last and most specific message
       }
+      elsif ($Line =~ /^Task: Updated ([a-zA-Z0-9.]+)$/)
+      {
+        $Summary->{$1} = "updated";
+      }
       elsif ($Line =~ /^Task: / or _IsPerlError($Line))
       {
         $Summary->{Task} = "failed";
-- 
2.20.1



More information about the wine-devel mailing list