From 5c869191c19f2a253ccb70d13c71d640244d0b62 Mon Sep 17 00:00:00 2001 From: Edward Lemur Date: Fri, 11 Oct 2019 20:08:17 +0000 Subject: [PATCH] Reland "depot_tools: Use vpython to execute fetch." This is a reland of 028367fe4a43d8e38fc34649865d65bec632925a Should be good to go https://bugs.chromium.org/p/chromium/issues/detail?id=993053#c36 Original change's description: > depot_tools: Use vpython to execute fetch. > > Bug: 1002153 > Change-Id: I11286bebc23bedada239d6ddb8ebb86207a41485 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1815707 > Reviewed-by: Anthony Polito > Commit-Queue: Edward Lesmes > Auto-Submit: Edward Lesmes Bug: 1002153 Change-Id: I20dbec88a030e0de201eaac88147e83028505102 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1854750 Reviewed-by: Andrii Shyshkalov Commit-Queue: Edward Lesmes --- fetch | 6 +++++- fetch.bat | 2 +- fetch.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/fetch b/fetch index bea6718c77..14a142791b 100755 --- a/fetch +++ b/fetch @@ -5,4 +5,8 @@ base_dir=$(dirname "$0") -PYTHONDONTWRITEBYTECODE=1 exec python "$base_dir/fetch.py" "$@" +# Ensure that "depot_tools" is somewhere in PATH so this tool can be used +# standalone, but allow other PATH manipulations to take priority. +PATH=$PATH:$base_dir + +PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/fetch.py" "$@" diff --git a/fetch.bat b/fetch.bat index 5f8019a19d..6afd53092c 100755 --- a/fetch.bat +++ b/fetch.bat @@ -12,4 +12,4 @@ call "%~dp0\update_depot_tools.bat" set PATH=%PATH%;%~dp0 :: Defer control. -python "%~dp0\fetch.py" %* +vpython "%~dp0\fetch.py" %* diff --git a/fetch.py b/fetch.py index 56abfb9a6d..72e52c7967 100755 --- a/fetch.py +++ b/fetch.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env vpython # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file.