Dan Jacques | 35c5b9a | 2017-09-28 21:58:22 -0400 | [diff] [blame] | 1 | #!/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 Lemur | f73f0f4 | 2019-09-16 22:23:45 +0000 | [diff] [blame] | 12 | # |
| 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 Jacques | 35c5b9a | 2017-09-28 21:58:22 -0400 | [diff] [blame] | 16 | |
| 17 | # Test if this script is running under a MinGW install. If it is, we will |
| 18 | # hardcode the paths to Git where possible. |
| 19 | OUTPUT="$(uname | grep 'MINGW')" |
| 20 | MINGW=$? |
| 21 | |
| 22 | if [ $MINGW = 0 ]; then |
| 23 | base_dir="${0%/*}" |
| 24 | else |
| 25 | base_dir=$(dirname "${BASH_SOURCE[0]}") |
| 26 | if [ -L "$base_dir" ]; then |
| 27 | base_dir=`cd "$base_dir" && pwd -P` |
| 28 | fi |
Edward Lemur | 2499525 | 2019-09-18 18:31:07 +0000 | [diff] [blame] | 29 | |
| 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 Jacques | 35c5b9a | 2017-09-28 21:58:22 -0400 | [diff] [blame] | 36 | fi |
| 37 | |
| 38 | # Sync CIPD-boostrapped packages. |
| 39 | source "$base_dir/cipd_bin_setup.sh" |
| 40 | cipd_bin_setup |
| 41 | |
| 42 | # Sync "gsutil.py". |
| 43 | python "$base_dir/gsutil.py" -- version 1> /dev/null |
| 44 | |
Mike Frysinger | 5329779 | 2019-08-20 21:32:33 +0000 | [diff] [blame] | 45 | # Sync all the pylint versions. |
| 46 | for 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 |
| 50 | done |
| 51 | |
Dan Jacques | 35c5b9a | 2017-09-28 21:58:22 -0400 | [diff] [blame] | 52 | # Cleanup. |
| 53 | find "$base_dir" -iname "*.pyc" -delete || true |