blob: 47e89940d8b8afe4f543ce646fe9076ab3fe0b7a [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.
Dan Jacques35c5b9a2017-09-28 21:58:22 -040012
13# Test if this script is running under a MinGW install. If it is, we will
14# hardcode the paths to Git where possible.
15OUTPUT="$(uname | grep 'MINGW')"
16MINGW=$?
17
18if [ $MINGW = 0 ]; then
19 base_dir="${0%/*}"
20else
21 base_dir=$(dirname "${BASH_SOURCE[0]}")
22 if [ -L "$base_dir" ]; then
23 base_dir=`cd "$base_dir" && pwd -P`
24 fi
25fi
26
Edward Lemur0e85f632019-09-11 22:20:27 +000027if [ "X$DEPOT_TOOLS_BOOTSTRAP_PYTHON3" != "X0" ]; then
28 source "$base_dir/bootstrap_python3"
29 bootstrap_python3
30fi
31
Dan Jacques35c5b9a2017-09-28 21:58:22 -040032# Sync CIPD-boostrapped packages.
33source "$base_dir/cipd_bin_setup.sh"
34cipd_bin_setup
35
36# Sync "gsutil.py".
37python "$base_dir/gsutil.py" -- version 1> /dev/null
38
Mike Frysinger53297792019-08-20 21:32:33 +000039# Sync all the pylint versions.
40for script in "$base_dir"/pylint-[0-9].[0-9]; do
41 # We have to silence stderr too because newer pylint versions will emit
42 # a spurious log to tell us what pylintrc file it's using. Ugh.
43 "$script" --version >/dev/null 2>&1
44done
45
Dan Jacques35c5b9a2017-09-28 21:58:22 -040046# Cleanup.
47find "$base_dir" -iname "*.pyc" -delete || true