Module: tools Branch: master Commit: 7d4c644fccff381619dbc49a48ae644daf7b81b4 URL: http://source.winehq.org/git/tools.git/?a=commit;h=7d4c644fccff381619dbc49a4...
Author: Francois Gouget fgouget@codeweavers.com Date: Thu May 15 15:48:45 2014 +0200
testbot: Better document the use of the staging directory.
Also remove an unused variable in CheckForWinetestUpdate.
---
testbot/bin/CheckForWinetestUpdate.pl | 13 +++++++++---- testbot/web/Submit.pl | 6 ++++-- 2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/testbot/bin/CheckForWinetestUpdate.pl b/testbot/bin/CheckForWinetestUpdate.pl index 5d30913..98165a3 100755 --- a/testbot/bin/CheckForWinetestUpdate.pl +++ b/testbot/bin/CheckForWinetestUpdate.pl @@ -175,7 +175,11 @@ umask 002; mkdir "$DataDir/latest"; mkdir "$DataDir/staging";
-my $LatestFileName = "$DataDir/latest/winetest${BitsSuffix}-latest.exe"; +# Store the new WineTest executable in the staging directory: +# - So we can compare it to the reference one in the latest directory to +# check that it is truly new. +# - Because we don't know the relevant Job and Step IDs yet and thus cannot +# put it in the jobs directory tree. my $FileNameRandomPart = GenerateRandomString(32); while (-e "$DataDir/staging/${FileNameRandomPart}_winetest${BitsSuffix}-latest.exe") { @@ -186,7 +190,7 @@ my $StagingFileName = "$DataDir/staging/${FileNameRandomPart}_winetest${BitsSuff my $UA = LWP::UserAgent->new(); $UA->agent("WineTestBot"); my $Request = HTTP::Request->new(GET => $WinetestUrl); -my $NowDate = gmtime; +my $LatestFileName = "$DataDir/latest/winetest${BitsSuffix}-latest.exe"; if (-r $LatestFileName) { my $Since = gmtime((stat $LatestFileName)[9]); @@ -230,14 +234,15 @@ if ($Bits == 32) { AddReconfigJob(); AddJob(1, $FileNameRandomPart, $Bits); - + + # Create another copy for the non-base VMs Job. $FileNameRandomPart = GenerateRandomString(32); while (-e "$DataDir/staging/${FileNameRandomPart}_winetest-latest.exe") { $FileNameRandomPart = GenerateRandomString(32); } $StagingFileName = "$DataDir/staging/${FileNameRandomPart}_winetest-latest.exe"; - if (! copy($LatestFileName, $StagingFileName)) + if (!copy($LatestFileName, $StagingFileName)) { LogMsg "Can't copy $LatestFileName to $StagingFileName: $!\n"; } diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl index 3bcfad9..d381150 100644 --- a/testbot/web/Submit.pl +++ b/testbot/web/Submit.pl @@ -792,8 +792,10 @@ sub OnSubmit return !1; }
- # Make sure the file has a unique name even when not picked up directly - # by the engine + # Store the file in the staging directory until the relevant Job and Step + # IDs are known and it can be moved to the jobs directory tree. But rename + # it so it does not get overwritten if the user submits another one before + # the Engine gets around to doing so. my $FileNameRandomPart = GenerateRandomString(32); while (-e ("$DataDir/staging/${FileNameRandomPart}_" . $self->GetParam("FileName")))