From 98eda3f3e42ae6548b41cbd08cffcc3779585de3 Mon Sep 17 00:00:00 2001 From: Edward Lesmes Date: Mon, 12 Aug 2019 21:09:53 +0000 Subject: [PATCH] Revert "depot_tools: Run Python scripts using vpython (Part 1)" This reverts commit d6186f993681ad1862236fb895dd4efb2f132bce. Reason for revert: Original change's description: > depot_tools: Run Python scripts using vpython (Part 1) > > Tbr: iannucci@chromium.org > Bug: 984182 > Change-Id: If36722e190d305f89d63dce91d0a600ddc34ebe3 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1748589 > Reviewed-by: Edward Lesmes > Commit-Queue: Edward Lesmes TBR=iannucci@chromium.org,ehmaldonado@chromium.org Change-Id: I7686985852608d0703bcbbab137df1ce82b29723 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 984182 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1749853 Reviewed-by: Edward Lesmes Commit-Queue: Edward Lesmes --- .gitattributes | 4 +--- git-runhooks | 4 ++-- git_cache.py | 2 +- git_cl.py | 2 +- git_drover.py | 2 +- git_find_releases.py | 2 +- git_footers.py | 2 +- git_freezer.py | 2 +- git_hyper_blame.py | 2 +- git_map.py | 2 +- git_map_branches.py | 2 +- git_mark_merge_base.py | 2 +- git_nav_downstream.py | 2 +- git_new_branch.py | 2 +- git_number.py | 2 +- git_rebase_update.py | 2 +- git_rename_branch.py | 2 +- git_reparent_branch.py | 2 +- git_retry.py | 2 +- git_squash_branch.py | 2 +- git_upstream_diff.py | 2 +- python_runner.sh | 6 +++--- 22 files changed, 25 insertions(+), 27 deletions(-) diff --git a/.gitattributes b/.gitattributes index 52954d930f..42810e8ea8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,10 +9,8 @@ /*.py recipes /*.sh recipes -# vpython and vpython specs -/vpython* +# vpython specs /gsutil.vpython recipes -/.vpython recipes # Extensionless tools we want and support scripts. /autoninja* recipes diff --git a/git-runhooks b/git-runhooks index 2686e3ec16..5bb503e511 100755 --- a/git-runhooks +++ b/git-runhooks @@ -15,9 +15,9 @@ gclient_spec="solutions=[{'name':'src','url':None,'deps_file':'.DEPS.git'}]" kernel_name=$(uname -s) if [ "${kernel_name:0:5}" = "MINGW" ]; then dir="${0%\\*}" - ${dir}\\vpython "${dir}\\gclient.py" "runhooks" "--spec=$gclient_spec" + cmd "/C ${dir}\\python.bat ${dir}\\gclient.py runhooks --spec=$gclient_spec" else dir="$(dirname $0)" - PYTHONDONTWRITEBYTECODE=1 exec $dir/vpython "$dir/gclient.py" runhooks --spec="$gclient_spec" + PYTHONDONTWRITEBYTECODE=1 exec python "$dir/gclient.py" runhooks --spec="$gclient_spec" fi exit $? diff --git a/git_cache.py b/git_cache.py index 91864a4287..45c63b4e05 100755 --- a/git_cache.py +++ b/git_cache.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # Copyright 2014 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. diff --git a/git_cl.py b/git_cl.py index 54fb2f3c58..a52b0ae989 100755 --- a/git_cl.py +++ b/git_cl.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # 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. diff --git a/git_drover.py b/git_drover.py index cec079042c..24eb077a89 100755 --- a/git_drover.py +++ b/git_drover.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # Copyright 2015 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. diff --git a/git_find_releases.py b/git_find_releases.py index c0d5af9019..cab723dd35 100755 --- a/git_find_releases.py +++ b/git_find_releases.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # Copyright 2015 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. diff --git a/git_footers.py b/git_footers.py index 61546b3d30..ad091b59df 100755 --- a/git_footers.py +++ b/git_footers.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # Copyright 2014 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. diff --git a/git_freezer.py b/git_freezer.py index 1bc2bc701d..ec277f5577 100755 --- a/git_freezer.py +++ b/git_freezer.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # Copyright 2014 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. diff --git a/git_hyper_blame.py b/git_hyper_blame.py index 6b35a1579f..3e085134db 100755 --- a/git_hyper_blame.py +++ b/git_hyper_blame.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # Copyright 2016 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. diff --git a/git_map.py b/git_map.py index 2e902c3ad9..278cfbe7c9 100755 --- a/git_map.py +++ b/git_map.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # Copyright 2014 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. diff --git a/git_map_branches.py b/git_map_branches.py index fcebc7a168..60cf317b27 100755 --- a/git_map_branches.py +++ b/git_map_branches.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # Copyright 2014 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. diff --git a/git_mark_merge_base.py b/git_mark_merge_base.py index 3b87471bfa..c6b3181020 100755 --- a/git_mark_merge_base.py +++ b/git_mark_merge_base.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # Copyright 2014 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. diff --git a/git_nav_downstream.py b/git_nav_downstream.py index 46a811c9d2..2d2287c18e 100755 --- a/git_nav_downstream.py +++ b/git_nav_downstream.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # Copyright 2014 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. diff --git a/git_new_branch.py b/git_new_branch.py index 9f4bc13aec..d61a42d790 100755 --- a/git_new_branch.py +++ b/git_new_branch.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # Copyright 2014 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. diff --git a/git_number.py b/git_number.py index 31d3653628..f3d2da7f90 100755 --- a/git_number.py +++ b/git_number.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # Copyright 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. diff --git a/git_rebase_update.py b/git_rebase_update.py index 27f76bb464..fa5b5c4f80 100755 --- a/git_rebase_update.py +++ b/git_rebase_update.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # Copyright 2014 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. diff --git a/git_rename_branch.py b/git_rename_branch.py index aa18cf5c52..c0ac42ec11 100755 --- a/git_rename_branch.py +++ b/git_rename_branch.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # Copyright 2014 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. diff --git a/git_reparent_branch.py b/git_reparent_branch.py index 09d55c42c9..083acae1b9 100755 --- a/git_reparent_branch.py +++ b/git_reparent_branch.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # Copyright 2014 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. diff --git a/git_retry.py b/git_retry.py index ec25f81956..bc3ce08097 100755 --- a/git_retry.py +++ b/git_retry.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # Copyright 2014 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. diff --git a/git_squash_branch.py b/git_squash_branch.py index d834b51621..f0534ca3cc 100755 --- a/git_squash_branch.py +++ b/git_squash_branch.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # Copyright 2014 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. diff --git a/git_upstream_diff.py b/git_upstream_diff.py index 84da12be44..c21828fe7c 100755 --- a/git_upstream_diff.py +++ b/git_upstream_diff.py @@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env python # Copyright 2014 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. diff --git a/python_runner.sh b/python_runner.sh index ca4ba17ec4..2834d1409e 100755 --- a/python_runner.sh +++ b/python_runner.sh @@ -47,9 +47,9 @@ SCRIPT="${SCRIPT-${BASENAME//-/_}.py}" if [[ $PYTHON_DIRECT = 1 ]]; then python.exe "$DEPOT_TOOLS\\$SCRIPT" "$@" else - if [ $OSTYPE = msys ]; then - PYTHONDONTWRITEBYTECODE=1 $DEPOT_TOOLS\\vpython "$DEPOT_TOOLS\\$SCRIPT" "$@" + if [[ -e "$DEPOT_TOOLS/python.bat" && $OSTYPE = msys ]]; then + cmd.exe //c "$DEPOT_TOOLS\\python.bat" "$DEPOT_TOOLS\\$SCRIPT" "$@" else - PYTHONDONTWRITEBYTECODE=1 exec $DEPOT_TOOLS/vpython "$DEPOT_TOOLS/$SCRIPT" "$@" + exec "$DEPOT_TOOLS/$SCRIPT" "$@" fi fi