From 5549faa54604ad182cc791a4f2f17091445eb460 Mon Sep 17 00:00:00 2001 From: "dnj@chromium.org" Date: Wed, 8 Apr 2015 01:54:09 +0000 Subject: [PATCH] Fix 'gsutil' self-discovery. Use 'realpath' instead of 'abspath' for self-discovery. This fixes an issue where 'gsutil' cannot find its dependencies when it is referenced through a symbolic link. Specifically, the symlink was: /b/scripts => /b/build/scripts 'gsutil' was called as: /b/scripts/slave/../../../depot_tools/third_party/gsutil/gsutil Because '/b/scripts/slave' resolves to '/b/build/scripts/slave', the three parent directory operators actually resolve to '/b', but 'os.path.abspath' blindly resolves them to '/'. BUG=chromium:474442 TEST=live - Signed onto failing bot, made this change, 'gsutil' works. R=hinoka@chromium.org Review URL: https://codereview.chromium.org/1060353002 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294712 0039d316-1c4b-4281-b951-d872f2087c98 --- third_party/gsutil/gsutil | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/gsutil/gsutil b/third_party/gsutil/gsutil index 49c83d01d..53249b11e 100755 --- a/third_party/gsutil/gsutil +++ b/third_party/gsutil/gsutil @@ -28,7 +28,7 @@ import socket import sys import traceback -third_party_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +third_party_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.insert(0, os.path.dirname(third_party_dir)) sys.path.insert(0, third_party_dir)