Chromium Code Reviews

Side by Side Diff: crup-runner.sh

Issue 12051022: Add a heuristic to skip git checkouts not managed by crup (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.
Jump to:
View unified diff |
« 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 45 matching lines...)
56 } 56 }
57 57
58 if [ -z "$*" ]; then 58 if [ -z "$*" ]; then
59 exit 0 59 exit 0
60 fi 60 fi
61 set -o pipefail 61 set -o pipefail
62 dir="$1" 62 dir="$1"
63 solution="${1%%/*}" 63 solution="${1%%/*}"
64 cd "$solution" 64 cd "$solution"
65 65
66 if ! grep -q -s "The Chromium Authors" ".git/description"; then
szager1 2013/01/23 17:22:46 This stanza should go in the 'if' clause below: i
jochen (gone - plz use gerrit) 2013/01/23 17:55:51 Done.
67 # Skip git checkouts not managed by crup.
68 exit 0
69 fi
70
66 if [ "$solution" = "$1" ]; then 71 if [ "$solution" = "$1" ]; then
67 # Don't "pull" if checkout is not on a named branch 72 # Don't "pull" if checkout is not on a named branch
68 shift 73 shift
69 if test "$2" = "pull" && ( ! git symbolic-ref HEAD >/dev/null 2>/dev/null ); t hen 74 if test "$2" = "pull" && ( ! git symbolic-ref HEAD >/dev/null 2>/dev/null ); t hen
70 first_args="$1 fetch" 75 first_args="$1 fetch"
71 else 76 else
72 first_args="$1 $2" 77 first_args="$1 $2"
73 fi 78 fi
74 shift 2 79 shift 2
75 $first_args $@ | sed "s/^/[$solution] /g" 1>&2 80 $first_args $@ | sed "s/^/[$solution] /g" 1>&2
(...skipping 12 matching lines...)
88 submodule="${1#*/}" 93 submodule="${1#*/}"
89 echo "[$solution] updating $submodule" 94 echo "[$solution] updating $submodule"
90 "$GIT_EXE" submodule update --quiet "$submodule" | 95 "$GIT_EXE" submodule update --quiet "$submodule" |
91 ( grep -v '^Skipping submodule' || true ) | sed "s|^|[$1] |g" 96 ( grep -v '^Skipping submodule' || true ) | sed "s|^|[$1] |g"
92 status=$? 97 status=$?
93 if [ "$status" -ne "0" ]; then 98 if [ "$status" -ne "0" ]; then
94 echo "[$solution] FAILED to update $submodule" 99 echo "[$solution] FAILED to update $submodule"
95 fi 100 fi
96 fi 101 fi
97 exit $status 102 exit $status
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine