find_depot_tools: put DEPS'd depot_tools first

Update find_depot_tools to put the pinned depot_tools from the DEPS file
first on the sys.path.

If a user/bot has depot_tools on their path already (likely pointing to
a global, auto-updated-to-master version), the scripts will still want
to find the pinned version, in case APIs change.

Bug: 773182
Change-Id: I26a55a5a463462911cd3324ed8c31dc9685144c0
Reviewed-on: https://chromium-review.googlesource.com/710315
Reviewed-by: Daniel Jacques <dnj@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Mike Bjorge <mbjorge@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#507779}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5064a49489a271975179a5341025ec2dafc9d8fd
This commit is contained in:
Mike Bjorge 2017-10-10 21:36:39 +00:00 коммит произвёл Commit Bot
Родитель f15b84f4c1
Коммит 534e6039ae
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -29,7 +29,9 @@ def add_depot_tools_to_path():
# First, check if we have a DEPS'd in "depot_tools".
deps_depot_tools = os.path.join(SRC, 'third_party', 'depot_tools')
if IsRealDepotTools(deps_depot_tools):
sys.path.append(deps_depot_tools)
# Put the pinned version at the start of the sys.path, in case there
# are other non-pinned versions already on the sys.path.
sys.path.insert(0, deps_depot_tools)
return deps_depot_tools
# Then look if depot_tools is already in PYTHONPATH.