File: ensure_bootstrap

package info (click to toggle)
chromium 139.0.7258.127-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,122,156 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (72 lines) | stat: -rwxr-xr-x 1,953 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/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.

# 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