Francois Gouget : testbot/CheckForWinetestUpdate: Hard link the latest WineTest.

Alexandre Julliard julliard at winehq.org
Mon May 21 13:42:16 CDT 2018


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

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Mon May 21 08:10:52 2018 +0200

testbot/CheckForWinetestUpdate: Hard link the latest WineTest.

This is ok because the latest WineTest executable is moved into place
rather than being overwritten.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/bin/CheckForWinetestUpdate.pl | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/testbot/bin/CheckForWinetestUpdate.pl b/testbot/bin/CheckForWinetestUpdate.pl
index a7abec7..37bd776 100755
--- a/testbot/bin/CheckForWinetestUpdate.pl
+++ b/testbot/bin/CheckForWinetestUpdate.pl
@@ -65,21 +65,10 @@ sub AddJob($$$)
 {
   my ($BaseJob, $LatestBaseName, $Bits) = @_;
 
-  # Create a copy in staging so it can then be moved into the job directory
-  my ($fh, $StagingFileName) = OpenNewFile("$DataDir/staging", "_$LatestBaseName");
-  if (!$fh)
-  {
-    LogMsg "Could not create the staging file: $!\n";
-    return 0;
-  }
-  if (!copy("$DataDir/latest/$LatestBaseName", $fh))
-  {
-    LogMsg "Could not copy '$DataDir/latest/$LatestBaseName' to '$StagingFileName': $!\n";
-    close($fh);
-    unlink($StagingFileName);
-    return 0;
-  }
-  close($fh);
+  # Create a hard link in staging so it can then be moved into the job
+  # directory. This is ok because the latest file is never overwritten.
+  my $StagingFileName = CreateNewLink("$DataDir/latest/$LatestBaseName",
+                                      "$DataDir/staging", "_$LatestBaseName");
 
   # First create a new job
   my $Jobs = CreateJobs();




More information about the wine-cvs mailing list