blob: 7751f06d2217f8b39f6f1e703db1c9bd3596850f [file] [log] [blame]
dan sinclairc9a3e472020-10-19 15:31:17 +00001#!/usr/bin/env bash
Austin Engcc2516a2023-10-17 20:57:54 +00002# Copyright 2020 The Dawn & Tint Authors
Dan Sinclair6e581892020-03-02 15:47:43 -05003#
Austin Engcc2516a2023-10-17 20:57:54 +00004# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are met:
Dan Sinclair6e581892020-03-02 15:47:43 -05006#
Austin Engcc2516a2023-10-17 20:57:54 +00007# 1. Redistributions of source code must retain the above copyright notice, this
8# list of conditions and the following disclaimer.
Dan Sinclair6e581892020-03-02 15:47:43 -05009#
Austin Engcc2516a2023-10-17 20:57:54 +000010# 2. Redistributions in binary form must reproduce the above copyright notice,
11# this list of conditions and the following disclaimer in the documentation
12# and/or other materials provided with the distribution.
13#
14# 3. Neither the name of the copyright holder nor the names of its
15# contributors may be used to endorse or promote products derived from
16# this software without specific prior written permission.
17#
18# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Dan Sinclair6e581892020-03-02 15:47:43 -050028
dan sinclairc9a3e472020-10-19 15:31:17 +000029# Defined to use origin/master instead of origin/main
30build=1
31buildtools=1
32clang=1
33cpplint=1
34googletest=1
35spirv_headers=1
36spirv_tools=1
37testing=1
Dan Sinclair6e581892020-03-02 15:47:43 -050038
39
dan sinclairc9a3e472020-10-19 15:31:17 +000040# This script assumes it's parent directory is the repo root.
41repo_path=$(dirname "$0")/..
Dan Sinclair6e581892020-03-02 15:47:43 -050042
dan sinclairc9a3e472020-10-19 15:31:17 +000043cd "$repo_path"
Dan Sinclair6e581892020-03-02 15:47:43 -050044
dan sinclairc9a3e472020-10-19 15:31:17 +000045if [[ $(git diff --stat) != '' ]]; then
46 echo "Working tree is dirty, commit changes before attempting to roll DEPS"
47 exit 1
48fi
Dan Sinclair6e581892020-03-02 15:47:43 -050049
dan sinclairc9a3e472020-10-19 15:31:17 +000050old_head=$(git rev-parse HEAD)
Dan Sinclair6e581892020-03-02 15:47:43 -050051
David Netod0bb9b32020-11-25 21:08:37 +000052for i in $(find third_party -maxdepth 1 -mindepth 1 -type d); do
dan sinclairc9a3e472020-10-19 15:31:17 +000053 name=`echo "${i%%/}" | cut -f2 -d'/' | tr '-' '_'`
Dan Sinclair6e581892020-03-02 15:47:43 -050054
dan sinclairc9a3e472020-10-19 15:31:17 +000055 if [ "x${name}" == "xcpplint" ]; then
56 continue
57 fi
Dan Sinclair6e581892020-03-02 15:47:43 -050058
dan sinclairc9a3e472020-10-19 15:31:17 +000059 trunk="origin/main"
60 if [ ! -z ${!name} ]; then
61 trunk="origin/master"
62 fi
Dan Sinclair6e581892020-03-02 15:47:43 -050063
dan sinclairc9a3e472020-10-19 15:31:17 +000064 roll-dep --ignore-dirty-tree --roll-to="${trunk}" "${i%%/}";
65done
Dan Sinclair6e581892020-03-02 15:47:43 -050066
dan sinclairc9a3e472020-10-19 15:31:17 +000067git rebase --interactive "${old_head}"