You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
depot_tools/ensure_bootstrap

73 lines
1.9 KiB
Plaintext

#!/usr/bin/env bash
# Copyright 2017 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.
Revert "Reland "depot_tools: Bootstrap Python 3 on Linux/Mac"" This reverts commits 0e85f633c7c4364f4d616e9e13dce2c9a9dd518e and 9d25ad41920eff43a8249f663e5f66d7d1b89d5f. Reason for revert: Causes problems for MinGW users. Original change's description: > Reland "depot_tools: Bootstrap Python 3 on Linux/Mac" > > This is a reland of dbca865e55f706efc3843eab2e88a65aa810be49 > > Original change's description: > > depot_tools: Bootstrap Python 3 on Linux/Mac > > > > This will make it possible for developers to execute depot_tools > > scripts using Python 3 in a known environment. > > > > Bug: 1002153 > > Change-Id: I5ff492a49d227c1b5876f49adba020f51a575bdd > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1762664 > > Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org> > > Reviewed-by: Dirk Pranke <dpranke@chromium.org> > > Reviewed-by: Andrii Shyshkalov <tandrii@google.com> > > Bug: 1002153 > Change-Id: I6938a76ffa05366c21f7c56aed3d07ecb2b84443 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1798845 > Reviewed-by: Dirk Pranke <dpranke@chromium.org> > Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org> TBR=iannucci@chromium.org,dpranke@chromium.org,tandrii@google.com,ehmaldonado@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 1002153 Change-Id: I3ee87b95b2532ec694d7f4f87cce8cde8ccf86eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1808137 Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
# TODO: This duplicates logic in "update_depot_tools". Update that script to
# invoke this script instead of manually calling "cipd_bin_setup" and other
# operations.
usage() {
cat <<EOF
Usage: $0
This is a shell script to ensure that all of the "depot_tools" bootstrap
programs are locally downloaded and ready for execution.
Unlike "update_depot_tools", this script works with the current
checkout, and will not update/sync the "depot_tools" repository.
EOF
}
if [ $# -ne 0 ]; then
case $1 in
-h|--help)
usage
exit 0
;;
*)
echo "$0: ERROR: script takes no arguments: $*" >&2
exit 1
;;
esac
fi
# Export for other depot_tools scripts to re-use.
export DEPOT_TOOLS_DIR="${DEPOT_TOOLS_DIR:-$(dirname "${BASH_SOURCE[0]}")}"
# Test if this script is running under a MinGW install. If it is, we will
# hardcode the paths to Git where possible.
OUTPUT="$(uname | grep 'MINGW')"
MINGW=$?
base_dir="${DEPOT_TOOLS_DIR}"
if [ $MINGW != 0 ]; then
# Don't bootstrap Python 3 on windows, since it is already done by
# bootstrap/win_tools.bat.
if [ "X$DEPOT_TOOLS_BOOTSTRAP_PYTHON3" != "X0" ]; then
source "$base_dir/bootstrap_python3"
bootstrap_python3
fi
fi
# Sync CIPD-boostrapped packages.
source "$base_dir/cipd_bin_setup.sh"
cipd_bin_setup &> /dev/null
# Sync "gsutil.py".
python3 "$base_dir/gsutil.py" -- version 1> /dev/null &
# Sync all the pylint versions.
for script in "$base_dir"/pylint-[0-9].[0-9]; do
# We have to silence stderr too because newer pylint versions will emit
# a spurious log to tell us what pylintrc file it's using. Ugh.
"$script" --version >/dev/null 2>&1 &
done
# Run bootstraps in parallel to help speed things up.
wait
# Cleanup.
find "$base_dir" -iname "*.pyc" -delete || true