OLD | NEW |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright 2014 Google Inc. | 2 # Copyright 2014 Google Inc. |
3 # | 3 # |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Crude script to clone the git skia repo into the current directory, which | 7 # Crude script to clone the git skia repo into the current directory, which |
8 # must be a CitC client. | 8 # must be a CitC client. |
9 # | 9 # |
10 # Usage: | 10 # Usage: |
11 # ./tools/git_clone_to_google3.sh | 11 # ./tools/git_clone_to_google3.sh |
12 | 12 |
13 prodcertstatus -q || (echo "Please run prodaccess." 1>&2; exit 1) | 13 prodcertstatus -q || (echo "Please run prodaccess." 1>&2; exit 1) |
14 source gbash.sh || exit 2 | 14 source gbash.sh || exit 2 |
15 | 15 |
16 DEFINE_string skia_rev "" "Git hash of Skia revision to clone, default LKGR." | 16 DEFINE_string skia_rev "" "Git hash of Skia revision to clone, default latest." |
17 gbash::init_google "$@" | 17 gbash::init_google "$@" |
18 | 18 |
19 set -e | 19 set -e |
20 | 20 |
21 # Checkout LKGR of Skia in a temp location. | 21 # Checkout specified revision of Skia in a temp location. |
22 TMP=$(gbash::make_temp_dir) | 22 TMP=$(gbash::make_temp_dir) |
23 pushd "${TMP}" | 23 pushd "${TMP}" |
24 git clone https://skia.googlesource.com/skia | 24 git clone https://skia.googlesource.com/skia |
25 cd skia | 25 cd skia |
26 git fetch | 26 git fetch |
27 if [ -z "${FLAGS_skia_rev}" ]; then | 27 if [[ -z "${FLAGS_skia_rev}" ]]; then |
28 # Retrieve latest revision. | |
29 FLAGS_skia_rev="$(git show --format=%H --no-patch origin/master)" | |
30 elif [[ "${FLAGS_skia_rev}" =~ "[Ll][Kk][Gg][Rr]" ]]; then | |
mtklein
2015/12/10 18:09:07
I agree so hard with this CL that we might conside
dogben
2015/12/10 18:18:38
Your wish is granted.
| |
28 # Retrieve last known good revision. | 31 # Retrieve last known good revision. |
29 MY_DIR="$(gbash::get_absolute_caller_dir)" | 32 MY_DIR="$(gbash::get_absolute_caller_dir)" |
30 FLAGS_skia_rev="$(${MY_DIR}/get_skia_lkgr.sh)" | 33 FLAGS_skia_rev="$(${MY_DIR}/get_skia_lkgr.sh)" |
31 fi | 34 fi |
32 git checkout --detach "${FLAGS_skia_rev}" | 35 git checkout --detach "${FLAGS_skia_rev}" |
33 | 36 |
34 # Rsync to google3 location. | 37 # Rsync to google3 location. |
35 popd | 38 popd |
36 # Use multichange client in case there are too many files for nomultichange. htt p://b/7292343 | 39 # Use multichange client in case there are too many files for nomultichange. htt p://b/7292343 |
37 g4 client --set_option multichange | 40 g4 client --set_option multichange |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 # will always change them to Unix line endings. | 91 # will always change them to Unix line endings. |
89 git update-index --skip-worktree make.bat | 92 git update-index --skip-worktree make.bat |
90 git update-index --skip-worktree make.py | 93 git update-index --skip-worktree make.py |
91 | 94 |
92 # Tell git to ignore files left out of the rsync (i.e. "deleted" files). | 95 # Tell git to ignore files left out of the rsync (i.e. "deleted" files). |
93 git status --porcelain | \ | 96 git status --porcelain | \ |
94 grep -e "^ D" | \ | 97 grep -e "^ D" | \ |
95 cut -c 4- | \ | 98 cut -c 4- | \ |
96 xargs git update-index --skip-worktree | 99 xargs git update-index --skip-worktree |
97 | 100 |
OLD | NEW |