• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2
3# Copyright 2015 gRPC authors.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#     http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17set -e
18
19export TEST=true
20
21cd "$(dirname "$0")/../../.."
22
23submodules=$(mktemp /tmp/submXXXXXX)
24want_submodules=$(mktemp /tmp/submXXXXXX)
25
26git submodule | sed 's/+//g' | awk '{ print $2 " " $1 }' | sort >"$submodules"
27cat <<EOF | sort >"$want_submodules"
28third_party/abseil-cpp 4447c7562e3bc702ade25105912dce503f0c4010
29third_party/benchmark 12235e24652fc7f809373e7c11a5f73c5763fc4c
30third_party/bloaty 60209eb1ccc34d5deefb002d1b7f37545204f7f2
31third_party/boringssl-with-bazel dec0d8f681348af8bb675e07bd89989665fca8bc
32third_party/cares/cares 6360e96b5cf8e5980c887ce58ef727e53d77243a
33third_party/envoy-api 88a37373e3cb5e1ab09e75dfb302b083168e6654
34third_party/googleapis fe8ba054ad4f7eca946c2d14a63c3f07c0b586a0
35third_party/googletest 2dd1c131950043a8ad5ab0d2dda0e0970596586a
36third_party/opencensus-proto 4aa53e15cbf1a47bc9087e6cfdca214c1eea4e89
37third_party/opentelemetry 60fa8754d890b5c55949a8c68dcfd7ab5c2395df
38third_party/opentelemetry-cpp 955a807c0461544560429c2414b8967f6023e590
39third_party/protobuf 2d4414f384dc499af113b5991ce3eaa9df6dd931
40third_party/protoc-gen-validate 32c2415389a3538082507ae537e7edd9578c64ed
41third_party/re2 0c5616df9c0aaa44c9440d87422012423d91c7d1
42third_party/xds 3a472e524827f72d1ad621c4983dd5af54c46776
43third_party/zlib 09155eaa2f9270dc4ed1fa13e2b4b2613e6e4851
44EOF
45
46if ! diff -u "$submodules" "$want_submodules"; then
47  if [ "$1" = "--fix" ]; then
48    while read -r path commit; do
49      git submodule update --init "$path"
50      (cd "$path" && git checkout "$commit")
51    done <"$want_submodules"
52    exit 0
53  fi
54  echo "Submodules are out of sync. Please update this script or run with --fix."
55  exit 1
56fi
57
58rm "$submodules" "$want_submodules"
59