浏览代码

[.bat] Remove "depot_tools" override. (#2)

Second attempt at landing. Fix quotes around python in "gclient.bat".

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: I0fceb99c8adb96e72dac706819be032d400aad37
Reviewed-on: https://chromium-review.googlesource.com/521704
Commit-Queue: Daniel Jacques <dnj@chromium.org>
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Dan Jacques 8 年之前
父节点
当前提交
74809c1b31
共有 13 个文件被更改,包括 91 次插入33 次删除
  1. 5 1
      apply_issue.bat
  2. 12 8
      cit.bat
  3. 5 1
      clang-format.bat
  4. 12 8
      clang_format_merge_driver.bat
  5. 5 1
      commit_queue.bat
  6. 8 1
      cpplint.bat
  7. 5 1
      depot-tools-auth.bat
  8. 6 1
      download_from_google_storage.bat
  9. 5 1
      fetch.bat
  10. 5 1
      gclient.bat
  11. 5 1
      gn.bat
  12. 12 7
      roll-dep-svn.bat
  13. 6 1
      roll-dep.bat

+ 5 - 1
apply_issue.bat

@@ -4,5 +4,9 @@
 :: 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.
-%~dp0python "%~dp0\apply_issue.py" %*
+python "%~dp0\apply_issue.py" %*

+ 12 - 8
cit.bat

@@ -1,8 +1,12 @@
-@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" %*
+@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" %*

+ 5 - 1
clang-format.bat

@@ -4,5 +4,9 @@
 :: 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.
-%~dp0python "%~dp0\clang_format.py" %*
+python "%~dp0\clang_format.py" %*

+ 12 - 8
clang_format_merge_driver.bat

@@ -1,8 +1,12 @@
-@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" %*
+@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" %*

+ 5 - 1
commit_queue.bat

@@ -4,5 +4,9 @@
 :: 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.
-%~dp0python "%~dp0\commit_queue.py" %*
+python "%~dp0\commit_queue.py" %*

+ 8 - 1
cpplint.bat

@@ -1,4 +1,11 @@
 @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
 
-call python "%~dp0cpplint.py" %*
+:: 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
+
+python "%~dp0cpplint.py" %*

+ 5 - 1
depot-tools-auth.bat

@@ -4,5 +4,9 @@
 :: 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.
-%~dp0python "%~dp0\depot-tools-auth.py" %*
+python "%~dp0\depot-tools-auth.py" %*

+ 6 - 1
download_from_google_storage.bat

@@ -2,6 +2,11 @@
 :: 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.
-%~dp0python "%~dp0\download_from_google_storage.py" %*
+python "%~dp0\download_from_google_storage.py" %*

+ 5 - 1
fetch.bat

@@ -7,5 +7,9 @@ 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.
-%~dp0python "%~dp0\fetch.py" %*
+python "%~dp0\fetch.py" %*

+ 5 - 1
gclient.bat

@@ -7,5 +7,9 @@ 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.
-"%~dp0python" "%~dp0gclient.py" %*
+python "%~dp0gclient.py" %*

+ 5 - 1
gn.bat

@@ -4,5 +4,9 @@
 :: 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.
-%~dp0python "%~dp0\gn.py" %*
+python "%~dp0\gn.py" %*

+ 12 - 7
roll-dep-svn.bat

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

+ 6 - 1
roll-dep.bat

@@ -2,6 +2,11 @@
 :: 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.
-%~dp0python "%~dp0\roll_dep.py" %*
+python "%~dp0\roll_dep.py" %*