Francois Gouget : testbot: Make Steps use the real filename for staging files too.

Alexandre Julliard julliard at winehq.org
Fri May 16 12:11:35 CDT 2014


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

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Fri May 16 15:49:58 2014 +0200

testbot: Make Steps use the real filename for staging files too.

---

 testbot/bin/CheckForWinetestUpdate.pl |    2 +-
 testbot/lib/WineTestBot/Patches.pm    |    2 +-
 testbot/lib/WineTestBot/Steps.pm      |   16 ++++++++--------
 testbot/web/Submit.pl                 |    4 ++--
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/testbot/bin/CheckForWinetestUpdate.pl b/testbot/bin/CheckForWinetestUpdate.pl
index fc24fb6..e9f07ac 100755
--- a/testbot/bin/CheckForWinetestUpdate.pl
+++ b/testbot/bin/CheckForWinetestUpdate.pl
@@ -70,7 +70,7 @@ sub AddJob
   my $NewStep = $Steps->Add();
   my $BitsSuffix = ($Bits == 64 ? "64" : "");
   $NewStep->Type("suite");
-  $NewStep->FileName("${FileNameRandomPart} winetest${BitsSuffix}-latest.exe");
+  $NewStep->FileName("${FileNameRandomPart}_winetest${BitsSuffix}-latest.exe");
   $NewStep->FileType($Bits == 64 ? "exe64" : "exe32");
   $NewStep->InStaging(1);
 
diff --git a/testbot/lib/WineTestBot/Patches.pm b/testbot/lib/WineTestBot/Patches.pm
index f54dc74..a4aed22 100644
--- a/testbot/lib/WineTestBot/Patches.pm
+++ b/testbot/lib/WineTestBot/Patches.pm
@@ -212,7 +212,7 @@ sub Submit
       $FileNameRandomPart = GenerateRandomString(32);
     }
     link $PatchFileName, "$DataDir/staging/${FileNameRandomPart}_patch.diff";
-    $NewStep->FileName($FileNameRandomPart . " patch.diff");
+    $NewStep->FileName($FileNameRandomPart . "_patch.diff");
     my @Keys = keys %{$Targets{$BaseName}};
     $NewStep->FileType($Targets{$BaseName}{$Keys[0]});
     $NewStep->InStaging(1);
diff --git a/testbot/lib/WineTestBot/Steps.pm b/testbot/lib/WineTestBot/Steps.pm
index 0acb3da..bd60ed1 100644
--- a/testbot/lib/WineTestBot/Steps.pm
+++ b/testbot/lib/WineTestBot/Steps.pm
@@ -67,23 +67,23 @@ sub HandleStaging
   }
 
   my $FileName = $self->FileName;
-  if (! ($FileName =~ m/^([\da-fA-F]+) (.*)$/))
+  if ($FileName !~ m/^[0-9a-f]+_(.*)$/)
   {
-    return "Can't split staging file name";
+    return "Can't split staging filename";
   }
-  $FileName = $2;
-  my $StagingFileName = "$DataDir/staging/$1_$FileName";
+  my $BaseName = $1;
+  my $StagingFileName = "$DataDir/staging/$FileName";
   my $FinalFileName = "$DataDir/jobs/$JobKey/" . $self->GetKey() .
-                      "/$FileName";
+                      "/$BaseName";
   mkdir "$DataDir/jobs/$JobKey";
   mkdir "$DataDir/jobs/$JobKey/" . $self->GetKey();
-  if (! copy($StagingFileName, $FinalFileName))
+  if (!copy($StagingFileName, $FinalFileName))
   {
-    return "Can't copy file from staging area: $!";
+    return "Can't move the staging file: $!";
   }
   unlink($StagingFileName);
 
-  $self->FileName($FileName);
+  $self->FileName($BaseName);
   $self->InStaging(!1);
   my ($ErrProperty, $ErrMessage) = $self->Save();
 
diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl
index d50a3d9..574c160 100644
--- a/testbot/web/Submit.pl
+++ b/testbot/web/Submit.pl
@@ -839,7 +839,7 @@ sub OnSubmit
   {
     # This is a patch so add a build step...
     my $BuildStep = $Steps->Add();
-    $BuildStep->FileName($FileNameRandomPart . " " . $self->GetParam("FileName"));
+    $BuildStep->FileName($FileNameRandomPart . "_" . $self->GetParam("FileName"));
     $BuildStep->FileType($FileType);
     $BuildStep->InStaging(1);
     $BuildStep->Type("build");
@@ -888,7 +888,7 @@ sub OnSubmit
         }
         else
         {
-          $TestStep->FileName($FileNameRandomPart . " " . $self->GetParam("FileName"));
+          $TestStep->FileName($FileNameRandomPart . "_" . $self->GetParam("FileName"));
           $TestStep->InStaging(1);
         }
         $TestStep->FileType("exe$Bits");




More information about the wine-cvs mailing list