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

Side by Side Diff: crup-runner.sh

Issue 12040046: Correctly forward error code when git pull fails in crup-runner.sh (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 7 years, 11 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
« no previous file with comments | « no previous file | no next file » | 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 set_target_os () { 3 set_target_os () {
4 # Get the os we're building for. On first run, this will be unset. 4 # Get the os we're building for. On first run, this will be unset.
5 target_os=$(git config target.os 2>/dev/null) 5 target_os=$(git config target.os 2>/dev/null)
6 if [ -z "$target_os" ]; then 6 if [ -z "$target_os" ]; then
7 case $(uname -s) in 7 case $(uname -s) in
8 Linux) target_os=unix ;; 8 Linux) target_os=unix ;;
9 Darwin) target_os=mac ;; 9 Darwin) target_os=mac ;;
10 CYGWIN*|MINGW*) target_os=win ;; 10 CYGWIN*|MINGW*) target_os=win ;;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 if [ "$solution" = "$1" ]; then 66 if [ "$solution" = "$1" ]; then
67 # Don't "pull" if checkout is not on a named branch 67 # Don't "pull" if checkout is not on a named branch
68 shift 68 shift
69 if test "$2" = "pull" && ( ! git symbolic-ref HEAD >/dev/null 2>/dev/null ); t hen 69 if test "$2" = "pull" && ( ! git symbolic-ref HEAD >/dev/null 2>/dev/null ); t hen
70 first_args="$1 fetch" 70 first_args="$1 fetch"
71 else 71 else
72 first_args="$1 $2" 72 first_args="$1 $2"
73 fi 73 fi
74 shift 2 74 shift 2
75 $first_args $@ | sed "s/^/[$solution] /g" 1>&2 75 $first_args $@ | sed "s/^/[$solution] /g" 1>&2
76 if [ $? -ne 0 ]; then 76 status=$?
77 exit $? 77 if [ "$status" -ne 0 ]; then
78 exit $status
78 fi 79 fi
79 80
80 set_target_os 81 set_target_os
81 82
82 "$GIT_EXE" ls-files -s | grep ^160000 | awk '{print $4}' | 83 "$GIT_EXE" ls-files -s | grep ^160000 | awk '{print $4}' |
83 while read submod; do 84 while read submod; do
84 process_submodule "$submod" 85 process_submodule "$submod"
85 done 86 done
86 status=$? 87 status=$?
87 else 88 else
88 submodule="${1#*/}" 89 submodule="${1#*/}"
89 echo "[$solution] updating $submodule" 90 echo "[$solution] updating $submodule"
90 "$GIT_EXE" submodule update --quiet "$submodule" | 91 "$GIT_EXE" submodule update --quiet "$submodule" |
91 ( grep -v '^Skipping submodule' || true ) | sed "s|^|[$1] |g" 92 ( grep -v '^Skipping submodule' || true ) | sed "s|^|[$1] |g"
92 status=$? 93 status=$?
93 if [ "$status" -ne "0" ]; then 94 if [ "$status" -ne "0" ]; then
94 echo "[$solution] FAILED to update $submodule" 95 echo "[$solution] FAILED to update $submodule"
95 fi 96 fi
96 fi 97 fi
97 exit $status 98 exit $status
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698