mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Revert "Remove py batch wrappers from root dir"
This reverts commit 0e8b3107e0.
Reason for revert: wrappers aren't being created in python2-bin, other disruptions
Original change's description:
> Remove py batch wrappers from root dir
>
> This removes python.bat and python3.bat batch wrappers from root of this
> repository. This change brings Windows set up closer to unix.
>
> depot_tools provides batch wrappers in python-bin and python2-bin
> directories and user can opt in to use it by adding them to PATH.
>
> Bug: 777069
> Change-Id: Ie7571a49f940e7a69b6c18779499c39aee94d06a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2742181
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@google.com>
> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Bug: 777069
Change-Id: Ieaadb032249fa5d6eea39668355c0c7de06dfbeb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2747702
Auto-Submit: Dirk Pranke <dpranke@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
This commit is contained in:
@@ -228,20 +228,15 @@ def clean_up_old_installations(skip_dir):
|
|||||||
that is using the bootstrapped Python!
|
that is using the bootstrapped Python!
|
||||||
"""
|
"""
|
||||||
root_contents = os.listdir(ROOT_DIR)
|
root_contents = os.listdir(ROOT_DIR)
|
||||||
cleanup_paths = ('win_tools-*_bin', 'python27*_bin', 'git-*_bin',
|
for f in ('win_tools-*_bin', 'python27*_bin', 'git-*_bin', 'bootstrap-*_bin'):
|
||||||
'bootstrap-*_bin', 'python.bat', 'python3.bat')
|
|
||||||
for f in cleanup_paths:
|
|
||||||
for entry in fnmatch.filter(root_contents, f):
|
for entry in fnmatch.filter(root_contents, f):
|
||||||
full_entry = os.path.join(ROOT_DIR, entry)
|
full_entry = os.path.join(ROOT_DIR, entry)
|
||||||
if full_entry == skip_dir:
|
if full_entry == skip_dir or not os.path.isdir(full_entry):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
logging.info('Cleaning up old installation %r', entry)
|
logging.info('Cleaning up old installation %r', entry)
|
||||||
if not _toolchain_in_use(full_entry):
|
if not _toolchain_in_use(full_entry):
|
||||||
if os.path.isdir(full_entry):
|
_safe_rmtree(full_entry)
|
||||||
_safe_rmtree(full_entry)
|
|
||||||
else:
|
|
||||||
os.remove(full_entry)
|
|
||||||
else:
|
else:
|
||||||
logging.info('Toolchain at %r is in-use; skipping', full_entry)
|
logging.info('Toolchain at %r is in-use; skipping', full_entry)
|
||||||
|
|
||||||
@@ -326,6 +321,8 @@ def main(argv):
|
|||||||
git_postprocess(template, os.path.join(bootstrap_dir, 'git'))
|
git_postprocess(template, os.path.join(bootstrap_dir, 'git'))
|
||||||
templates = [
|
templates = [
|
||||||
('git-bash.template.sh', 'git-bash', ROOT_DIR),
|
('git-bash.template.sh', 'git-bash', ROOT_DIR),
|
||||||
|
('python27.bat', 'python.bat', ROOT_DIR),
|
||||||
|
('python3.bat', 'python3.bat', ROOT_DIR),
|
||||||
]
|
]
|
||||||
for src_name, dst_name, dst_dir in templates:
|
for src_name, dst_name, dst_dir in templates:
|
||||||
# Re-evaluate and regenerate our root templated files.
|
# Re-evaluate and regenerate our root templated files.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ gclient_spec="solutions=[{'name':'src','url':None,'deps_file':'.DEPS.git'}]"
|
|||||||
kernel_name=$(uname -s)
|
kernel_name=$(uname -s)
|
||||||
if [ "${kernel_name:0:5}" = "MINGW" ]; then
|
if [ "${kernel_name:0:5}" = "MINGW" ]; then
|
||||||
dir="${0%\\*}"
|
dir="${0%\\*}"
|
||||||
cmd "/C ${dir}\\python2-bin\\python.bat ${dir}\\gclient.py runhooks --spec=$gclient_spec"
|
cmd "/C ${dir}\\python.bat ${dir}\\gclient.py runhooks --spec=$gclient_spec"
|
||||||
else
|
else
|
||||||
dir="$(dirname $0)"
|
dir="$(dirname $0)"
|
||||||
PYTHONDONTWRITEBYTECODE=1 exec python "$dir/gclient.py" runhooks --spec="$gclient_spec"
|
PYTHONDONTWRITEBYTECODE=1 exec python "$dir/gclient.py" runhooks --spec="$gclient_spec"
|
||||||
|
|||||||
@@ -3,10 +3,5 @@
|
|||||||
:: Use of this source code is governed by a BSD-style license that can be
|
:: Use of this source code is governed by a BSD-style license that can be
|
||||||
:: found in the LICENSE file.
|
:: found in the LICENSE file.
|
||||||
|
|
||||||
:: TODO(crbug.com/1003139): Remove.
|
|
||||||
:: Add Python 3 to PATH to work around crbug.com/1003139.
|
|
||||||
for /f %%i in (%~dp0python_bin_reldir.txt) do set PYTHON2_BIN_RELDIR=%%i
|
|
||||||
set PATH=%~dp0%PYTHON2_BIN_RELDIR%;%~dp0%PYTHON2_BIN_RELDIR%\Scripts;%~dp0%PYTHON2_BIN_RELDIR%\DLLs;%PATH%
|
|
||||||
|
|
||||||
call "%~dp0\cipd_bin_setup.bat" > nul 2>&1
|
call "%~dp0\cipd_bin_setup.bat" > nul 2>&1
|
||||||
"%~dp0\.cipd_bin\vpython.exe" -vpython-interpreter "%~dp0\%PYTHON2_BIN_RELDIR%\python.exe" %*
|
"%~dp0\.cipd_bin\vpython.exe" -vpython-interpreter "%~dp0\python.bat" %*
|
||||||
|
|||||||
Reference in New Issue
Block a user