• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env bash
2# Copyright (c) 2021 Google LLC
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16# Attempts to roll all entries in DEPS to tip-of-tree and create a commit.
17#
18# Depends on roll-dep from depot_tools
19# (https://chromium.googlesource.com/chromium/tools/depot_tools) being in PATH.
20
21set -eo pipefail
22
23effcee_dir="external/effcee/"
24effcee_trunk="origin/main"
25googletest_dir="external/googletest/"
26googletest_trunk="origin/main"
27re2_dir="external/re2/"
28re2_trunk="origin/main"
29spirv_headers_dir="external/spirv-headers/"
30spirv_headers_trunk="origin/master"
31
32# This script assumes it's parent directory is the repo root.
33repo_path=$(dirname "$0")/..
34
35cd "$repo_path"
36
37if [[ $(git diff --stat) != '' ]]; then
38    echo "Working tree is dirty, commit changes before attempting to roll DEPS"
39    exit 1
40fi
41
42echo "*** Ignore messages about running 'git cl upload' ***"
43
44old_head=$(git rev-parse HEAD)
45
46set +e
47roll-dep --ignore-dirty-tree --roll-to="${effcee_trunk}" "${effcee_dir}"
48roll-dep --ignore-dirty-tree --roll-to="${googletest_trunk}" "${googletest_dir}"
49roll-dep --ignore-dirty-tree --roll-to="${re2_trunk}" "${re2_dir}"
50roll-dep --ignore-dirty-tree --roll-to="${spirv_headers_trunk}" "${spirv_headers_dir}"
51
52git rebase --interactive "${old_head}"
53
54