Browse Source

Reland "depot_tools: Use vpython to execute fetch."

This is a reland of 028367fe4a43d8e38fc34649865d65bec632925a

Should work on Skia after https://skia-review.googlesource.com/c/skia/+/244116

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 <apolito@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>

Bug: 1002153
Change-Id: Ifdde3c4a817ab6ca222c82c5448d630e85bf2a4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1827719
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Edward Lemur 5 years ago
parent
commit
b37784118c
3 changed files with 7 additions and 3 deletions
  1. 5 1
      fetch
  2. 1 1
      fetch.bat
  3. 1 1
      fetch.py

+ 5 - 1
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" "$@"

+ 1 - 1
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" %*

+ 1 - 1
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.