Francois Gouget : testbot/TestAgent: Also dereference symbolic links to better find $::RootDir.

Alexandre Julliard julliard at winehq.org
Thu Dec 17 15:29:53 CST 2020


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

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu Dec 17 11:53:33 2020 +0100

testbot/TestAgent: Also dereference symbolic links to better find $::RootDir.

This allows putting a symbolic link to TestAgent in $PATH.

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

---

 testbot/scripts/TestAgent | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/testbot/scripts/TestAgent b/testbot/scripts/TestAgent
index 40f443e..10bdc63 100755
--- a/testbot/scripts/TestAgent
+++ b/testbot/scripts/TestAgent
@@ -23,12 +23,10 @@ use strict;
 
 sub BEGIN
 {
-  if ($0 !~ m=^/=)
-  {
-    # Turn $0 into an absolute path so it can safely be used in @INC
-    require Cwd;
-    $0 = Cwd::cwd() . "/$0";
-  }
+  # Turn $0 into an absolute path so it can safely be used in @INC.
+  # Also dereference symbolic links to better find $::RootDir.
+  use Cwd 'abs_path';
+  $0 = abs_path($0);
   if ($0 =~ m=^(/.*)/[^/]+/[^/]+$=)
   {
     $::RootDir = $1;




More information about the wine-cvs mailing list