Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Side by Side Diff: crup-runner.sh

Issue 11645056: Some polishing... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 7 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | git-crup » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 if [ -z "$*" ]; then 3 if [ -z "$*" ]; then
4 exit 0 4 exit 0
5 fi 5 fi
6 set -o pipefail 6 set -o pipefail
7 dir="$1" 7 dir="$1"
8 solution="${1%%/*}" 8 solution="${1%%/*}"
9 cd "$solution" 9 cd "$solution"
10 if [ "$solution" = "$1" ]; then 10 if [ "$solution" = "$1" ]; then
11 shift 11 shift
12 $@ | sed "s/^/[$solution] /g" 1>&2 12 # Don't "pull" if checkout is not on a named branch
13 if test "$2" = "pull" && ( ! git symbolic-ref HEAD >/dev/null 2>/dev/null ); t hen
14 first_args="$1 fetch"
15 else
16 first_args="$1 $2"
17 fi
18 shift 2
19 $first_args $@ | sed "s/^/[$solution] /g" 1>&2
13 if [ $? -ne 0 ]; then 20 if [ $? -ne 0 ]; then
14 exit $? 21 exit $?
15 fi 22 fi
16 "$GIT_EXE" submodule --quiet sync 23 "$GIT_EXE" submodule --quiet sync
17 "$GIT_EXE" ls-files -s | grep ^160000 | awk '{print $4}' | 24 "$GIT_EXE" ls-files -s | grep ^160000 | awk '{print $4}' |
18 sed "s/^/$solution\//g" 25 while read submod; do
26 # Check whether this submodule should be ignored or updated.
27 # If it's a new submodule, match the os specified in .gitmodules against
28 # the os specified in .git/config.
29 update_policy=$(git config "submodule.$submod.update" 2>/dev/null)
30 if [ -z "$update_policy" ]; then
31 target_os=$(git config target.os 2>/dev/null)
32 submod_os=$(git config -f .gitmodules "submodule.$submod.os" 2>/dev/null)
33 if [ -n "$target_os" -a -n "$submod_os" ] &&
34 [ "$submod_os" != "all" -a "$submod_os" != "$target_os" ]; then
35 update_policy=none
36 else
37 update_policy=checkout
38 fi
39 git config "submodule.$submod.update" $update_policy 2>/dev/null
40 fi
41 if [ "$update_policy" != "none" ]; then
42 echo "$solution/$submod"
43 fi
44 done
19 status=$? 45 status=$?
20 else 46 else
21 submodule="${1#*/}" 47 submodule="${1#*/}"
22 echo "[$solution] updating $submodule ..." 48 echo "[$solution] updating $submodule ..."
23 "$GIT_EXE" submodule update --quiet --init "$submodule" | 49 "$GIT_EXE" submodule update --quiet --init "$submodule" |
24 ( grep -v '^Skipping submodule' || true ) | sed "s|^|[$1] |g" 50 ( grep -v '^Skipping submodule' || true ) | sed "s|^|[$1] |g"
25 status=$? 51 status=$?
26 if [ "$status" -ne "0" ]; then 52 if [ "$status" -ne "0" ]; then
27 echo "[$solution] FAILED to update $submodule" 53 echo "[$solution] FAILED to update $submodule"
28 fi 54 fi
29 fi 55 fi
30 exit $status 56 exit $status
OLDNEW
« no previous file with comments | « no previous file | git-crup » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698