OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # A convenience script to largely replicate the behavior of `gclient sync` in a | 6 # A convenience script to largely replicate the behavior of `gclient sync` in a |
7 # submodule-based checkout. Fetches latest commits for top-level solutions; | 7 # submodule-based checkout. Fetches latest commits for top-level solutions; |
8 # updates submodules; and runs post-sync hooks. | 8 # updates submodules; and runs post-sync hooks. |
9 | 9 |
10 export GIT_MERGE_AUTOEDIT=0 | 10 export GIT_MERGE_AUTOEDIT=0 |
11 | 11 |
12 ECHO= | 12 ECHO= |
13 pull=pull | 13 pull=pull |
14 pull_args= | 14 pull_args= |
15 hooks=yes | 15 hooks=yes |
16 j=10 | 16 j=10 |
17 crup_runner="crup-runner.sh" | 17 crup_runner="crup-runner.sh" |
| 18 runhooks="git-runhooks" |
18 | 19 |
19 kernel_name=$(uname -s) | 20 kernel_name=$(uname -s) |
20 if [ "${kernel_name:0:5}" = "MINGW" -o "${kernel_name:0:6}" = "CYGWIN" ]; then | 21 if [ "${kernel_name:0:5}" = "MINGW" -o "${kernel_name:0:6}" = "CYGWIN" ]; then |
21 GIT_EXE=git.exe | 22 GIT_EXE=git.exe |
22 else | 23 else |
23 GIT_EXE=git | 24 GIT_EXE=git |
24 fi | 25 fi |
25 export GIT_EXE | 26 export GIT_EXE |
26 | 27 |
27 if ( echo test | xargs --max-lines=1 true 2>/dev/null ); then | 28 if ( echo test | xargs --max-lines=1 true 2>/dev/null ); then |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 else | 128 else |
128 ls -d */.git | | 129 ls -d */.git | |
129 while read gitdir; do | 130 while read gitdir; do |
130 serial_update "${gitdir%%/.git}" | 131 serial_update "${gitdir%%/.git}" |
131 done | 132 done |
132 fi | 133 fi |
133 | 134 |
134 status=$? | 135 status=$? |
135 | 136 |
136 if [ "$hooks" = "yes" -a "$status" -eq 0 ]; then | 137 if [ "$hooks" = "yes" -a "$status" -eq 0 ]; then |
137 gclient_spec="solutions=[{'name':'src','url':None,'deps_file':'.DEPS.git'}]" | 138 "$runhooks" |
138 gclient runhooks --spec="$gclient_spec" | |
139 status=$? | 139 status=$? |
140 fi | 140 fi |
141 | 141 |
142 echo | 142 echo |
143 exit $status | 143 exit $status |
OLD | NEW |