From 96fa295ab453feee177e3b6cf0992d576cf87af5 Mon Sep 17 00:00:00 2001 From: Daniel Jacques Date: Thu, 1 Jun 2017 20:43:09 +0000 Subject: [PATCH] Revert "[.bat] Remove "depot_tools" override." This reverts commit 2f5f0b7a99c9df653b090e3ef00d13a2cab00a8d. Reason for revert: Original change's description: > [.bat] Remove "depot_tools" override. > > Currently, all ".bat" entry points use "~dp0python" to ensure that the > Python that is used to execute the tool is the one in depot_tools. This > prevents any sort of system override. > > Remove this override so that PATH solely determines which Python is > used. To accommodate users who invoked these tools without Python on the > PATH, we still still add "depot_tools" as a catch-all PATH suffix. > > Some tools were also not using DOS-style line endings. This CL fixes > this. > > BUG=chromium:714293, chromium:724902 > TEST=None > > Change-Id: I06e9583a668c767196a2a335547aded868f2a2b5 > Reviewed-on: https://chromium-review.googlesource.com/517236 > Commit-Queue: Daniel Jacques > Reviewed-by: Robbie Iannucci > Reviewed-by: Marc-Antoine Ruel > TBR=maruel@chromium.org,iannucci@chromium.org,vadimsh@chromium.org,dnj@chromium.org No-Presubmit: true No-Tree-Checks: true No-Try: true BUG=chromium:714293, chromium:724902 Change-Id: I822abdd4e02abd32d2f4789fb16d5a7f78fdd02d Reviewed-on: https://chromium-review.googlesource.com/521867 Reviewed-by: Daniel Jacques Commit-Queue: Daniel Jacques --- apply_issue.bat | 6 +----- cit.bat | 20 ++++++++------------ clang-format.bat | 6 +----- clang_format_merge_driver.bat | 20 ++++++++------------ commit_queue.bat | 6 +----- cpplint.bat | 7 ------- depot-tools-auth.bat | 6 +----- download_from_google_storage.bat | 7 +------ fetch.bat | 6 +----- gclient.bat | 6 +----- gn.bat | 6 +----- roll-dep-svn.bat | 19 +++++++------------ roll-dep.bat | 7 +------ 13 files changed, 32 insertions(+), 90 deletions(-) diff --git a/apply_issue.bat b/apply_issue.bat index 30bc306bc..2a035062b 100755 --- a/apply_issue.bat +++ b/apply_issue.bat @@ -4,9 +4,5 @@ :: found in the LICENSE file. setlocal -:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used -:: standalone, but allow other PATH manipulations to take priority. -set PATH=%PATH%;%~dp0 - :: Defer control. -python "%~dp0\apply_issue.py" %* +%~dp0python "%~dp0\apply_issue.py" %* diff --git a/cit.bat b/cit.bat index 82919b936..8f79044aa 100755 --- a/cit.bat +++ b/cit.bat @@ -1,12 +1,8 @@ -@echo off -:: Copyright (c) 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. -setlocal - -:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used -:: standalone, but allow other PATH manipulations to take priority. -set PATH=%PATH%;%~dp0 - -:: Defer control. -python "%~dp0\cit.py" %* +@echo off +:: Copyright (c) 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. +setlocal + +:: Defer control. +%~dp0python "%~dp0\cit.py" %* diff --git a/clang-format.bat b/clang-format.bat index c3bb53bc4..884cd246a 100644 --- a/clang-format.bat +++ b/clang-format.bat @@ -4,9 +4,5 @@ :: found in the LICENSE file. setlocal -:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used -:: standalone, but allow other PATH manipulations to take priority. -set PATH=%PATH%;%~dp0 - :: Defer control. -python "%~dp0\clang_format.py" %* +%~dp0python "%~dp0\clang_format.py" %* diff --git a/clang_format_merge_driver.bat b/clang_format_merge_driver.bat index 8e614b492..6f15dd749 100755 --- a/clang_format_merge_driver.bat +++ b/clang_format_merge_driver.bat @@ -1,12 +1,8 @@ -@echo off -:: 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. -setlocal - -:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used -:: standalone, but allow other PATH manipulations to take priority. -set PATH=%PATH%;%~dp0 - -:: Defer control. -python "%~dp0\clang_format_merge_driver.py" %* +@echo off +:: 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. +setlocal + +:: Defer control. +%~dp0python "%~dp0\clang_format_merge_driver.py" %* diff --git a/commit_queue.bat b/commit_queue.bat index 44639a64d..c1babf04c 100755 --- a/commit_queue.bat +++ b/commit_queue.bat @@ -4,9 +4,5 @@ :: found in the LICENSE file. setlocal -:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used -:: standalone, but allow other PATH manipulations to take priority. -set PATH=%PATH%;%~dp0 - :: Defer control. -python "%~dp0\commit_queue.py" %* +%~dp0python "%~dp0\commit_queue.py" %* diff --git a/cpplint.bat b/cpplint.bat index 30faf8bbb..914eecf1a 100644 --- a/cpplint.bat +++ b/cpplint.bat @@ -1,11 +1,4 @@ @echo off -:: 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. setlocal -:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used -:: standalone, but allow other PATH manipulations to take priority. -set PATH=%PATH%;%~dp0 - call python "%~dp0cpplint.py" %* diff --git a/depot-tools-auth.bat b/depot-tools-auth.bat index 37280b765..4770ed6fb 100644 --- a/depot-tools-auth.bat +++ b/depot-tools-auth.bat @@ -4,9 +4,5 @@ :: found in the LICENSE file. setlocal -:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used -:: standalone, but allow other PATH manipulations to take priority. -set PATH=%PATH%;%~dp0 - :: Defer control. -python "%~dp0\depot-tools-auth.py" %* +%~dp0python "%~dp0\depot-tools-auth.py" %* diff --git a/download_from_google_storage.bat b/download_from_google_storage.bat index f1f2d2161..4c7971b42 100755 --- a/download_from_google_storage.bat +++ b/download_from_google_storage.bat @@ -2,11 +2,6 @@ :: Copyright (c) 2012 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. -setlocal - -:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used -:: standalone, but allow other PATH manipulations to take priority. -set PATH=%PATH%;%~dp0 :: Defer control. -python "%~dp0\download_from_google_storage.py" %* +%~dp0python "%~dp0\download_from_google_storage.py" %* diff --git a/fetch.bat b/fetch.bat index 5f8019a19..d6ea944e2 100755 --- a/fetch.bat +++ b/fetch.bat @@ -7,9 +7,5 @@ setlocal :: Synchronize the root directory before deferring control back to gclient.py. call "%~dp0\update_depot_tools.bat" -:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used -:: standalone, but allow other PATH manipulations to take priority. -set PATH=%PATH%;%~dp0 - :: Defer control. -python "%~dp0\fetch.py" %* +%~dp0python "%~dp0\fetch.py" %* diff --git a/gclient.bat b/gclient.bat index 3d2fe2627..d66ce6a41 100755 --- a/gclient.bat +++ b/gclient.bat @@ -7,9 +7,5 @@ setlocal :: Synchronize the root directory before deferring control back to gclient.py. call "%~dp0update_depot_tools.bat" %* -:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used -:: standalone, but allow other PATH manipulations to take priority. -set PATH=%PATH%;%~dp0 - :: Defer control. -"python" "%~dp0gclient.py" %* +"%~dp0python" "%~dp0gclient.py" %* diff --git a/gn.bat b/gn.bat index 9eb6b56a1..0a42a0766 100644 --- a/gn.bat +++ b/gn.bat @@ -4,9 +4,5 @@ :: found in the LICENSE file. setlocal -:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used -:: standalone, but allow other PATH manipulations to take priority. -set PATH=%PATH%;%~dp0 - :: Defer control. -python "%~dp0\gn.py" %* +%~dp0python "%~dp0\gn.py" %* diff --git a/roll-dep-svn.bat b/roll-dep-svn.bat index 6ff5db78f..b2aec795e 100755 --- a/roll-dep-svn.bat +++ b/roll-dep-svn.bat @@ -1,12 +1,7 @@ -@echo off -:: Copyright (c) 2012 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. -setlocal - -:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used -:: standalone, but allow other PATH manipulations to take priority. -set PATH=%PATH%;%~dp0 - -:: Defer control. -python "%~dp0\roll_dep_svn.py" %* +@echo off +:: Copyright (c) 2012 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. + +:: Defer control. +%~dp0python "%~dp0\roll_dep_svn.py" %* diff --git a/roll-dep.bat b/roll-dep.bat index c49c88dc5..d5166dfa8 100755 --- a/roll-dep.bat +++ b/roll-dep.bat @@ -2,11 +2,6 @@ :: Copyright (c) 2012 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. -setlocal - -:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used -:: standalone, but allow other PATH manipulations to take priority. -set PATH=%PATH%;%~dp0 :: Defer control. -python "%~dp0\roll_dep.py" %* +%~dp0python "%~dp0\roll_dep.py" %*