OLD | NEW |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
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 j=10 | 10 j=10 |
(...skipping 24 matching lines...) Expand all Loading... | |
35 git ls-files -s | grep ^160000 | awk '{print $4}' | | 35 git ls-files -s | grep ^160000 | awk '{print $4}' | |
36 xargs $max_lines -P "$j" $ECHO git submodule update --init | 36 xargs $max_lines -P "$j" $ECHO git submodule update --init |
37 else | 37 else |
38 echo "Warn: parallel execution is not supported on this platform." | 38 echo "Warn: parallel execution is not supported on this platform." |
39 $ECHO git submodule update --init | 39 $ECHO git submodule update --init |
40 fi ) | 40 fi ) |
41 } | 41 } |
42 | 42 |
43 while test $# -ne 0; do | 43 while test $# -ne 0; do |
44 case "$1" in | 44 case "$1" in |
45 -j[0-9]*) | |
46 j=$(echo "$1" | cut -c3-) | |
47 ;; | |
48 --jobs=[0-9]*) | |
49 j=$(echo "$1" | cut -c8-) | |
50 ;; | |
cmp
2012/08/02 17:21:53
increase indent on lines 49-50 by 1 space
szager
2012/08/02 17:23:50
Done.
| |
45 -j|--jobs) | 51 -j|--jobs) |
46 if test -n "$2"; then | 52 case "$2" in |
47 j="$2" | 53 ''|-*) |
48 shift | 54 j=0 |
49 else | 55 ;; |
50 j=0 | 56 *) |
51 fi | 57 j="$2" |
58 shift | |
59 ;; | |
60 esac | |
52 ;; | 61 ;; |
53 -n|--dry-run) | 62 -n|--dry-run) |
54 ECHO=echo | 63 ECHO=echo |
55 ;; | 64 ;; |
56 -h|--help) | 65 -h|--help) |
57 usage | 66 usage |
58 exit 0 | 67 exit 0 |
59 ;; | 68 ;; |
60 --fetch) | 69 --fetch) |
61 pull=fetch | 70 pull=fetch |
(...skipping 20 matching lines...) Expand all Loading... | |
82 exit 1 | 91 exit 1 |
83 fi | 92 fi |
84 | 93 |
85 ls -d */.git | | 94 ls -d */.git | |
86 while read gitdir; do | 95 while read gitdir; do |
87 parallel_update `dirname $gitdir` | 96 parallel_update `dirname $gitdir` |
88 done | 97 done |
89 | 98 |
90 gclient_spec="solutions=[{'name':'src','url':None,'deps_file':'.DEPS.git'}]" | 99 gclient_spec="solutions=[{'name':'src','url':None,'deps_file':'.DEPS.git'}]" |
91 test "$hooks" = "yes" && gclient runhooks --spec="$gclient_spec" | 100 test "$hooks" = "yes" && gclient runhooks --spec="$gclient_spec" |
OLD | NEW |