blob: 514845a6a0801bf94ab34fa160e6080ecbbdf11f [file] [log] [blame]
Dan Jacques35c5b9a2017-09-28 21:58:22 -04001#!/usr/bin/env bash
2
3# Copyright 2017 The Chromium Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7# This is a shell script to ensure that all of the "depot_tools" bootstrap
8# programs are locally downloaded and ready for execution.
9#
10# Unlike "update_depot_tools", this script works with the current
11# checkout, and will not update/sync the "depot_tools" repository.
Edward Lemurf73f0f42019-09-16 22:23:45 +000012#
13# TODO: This duplicates logic in "update_depot_tools". Update that script to
14# invoke this script instead of manually calling "cipd_bin_setup" and other
15# operations.
Dan Jacques35c5b9a2017-09-28 21:58:22 -040016
17# Test if this script is running under a MinGW install. If it is, we will
18# hardcode the paths to Git where possible.
19OUTPUT="$(uname | grep 'MINGW')"
20MINGW=$?
21
22if [ $MINGW = 0 ]; then
23 base_dir="${0%/*}"
24else
25 base_dir=$(dirname "${BASH_SOURCE[0]}")
26 if [ -L "$base_dir" ]; then
27 base_dir=`cd "$base_dir" && pwd -P`
28 fi
Edward Lemur24995252019-09-18 18:31:07 +000029
30 # Don't bootstrap Python 3 on windows, since it is already done by
31 # bootstrap/win_tools.bat.
32 if [ "X$DEPOT_TOOLS_BOOTSTRAP_PYTHON3" != "X0" ]; then
33 source "$base_dir/bootstrap_python3"
34 bootstrap_python3
35 fi
Dan Jacques35c5b9a2017-09-28 21:58:22 -040036fi
37
38# Sync CIPD-boostrapped packages.
39source "$base_dir/cipd_bin_setup.sh"
40cipd_bin_setup
41
42# Sync "gsutil.py".
43python "$base_dir/gsutil.py" -- version 1> /dev/null
44
Mike Frysinger53297792019-08-20 21:32:33 +000045# Sync all the pylint versions.
46for script in "$base_dir"/pylint-[0-9].[0-9]; do
47 # We have to silence stderr too because newer pylint versions will emit
48 # a spurious log to tell us what pylintrc file it's using. Ugh.
49 "$script" --version >/dev/null 2>&1
50done
51
Dan Jacques35c5b9a2017-09-28 21:58:22 -040052# Cleanup.
53find "$base_dir" -iname "*.pyc" -delete || true