OLD | NEW |
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 [ "$solution" = "$1" ]; then | 66 if [ "$solution" = "$1" ]; then |
| 67 # Skip git checkouts not managed by crup. |
| 68 if ! grep -q -s "The Chromium Authors" ".git/description"; then |
| 69 echo "Skipping unmanaged git directory $1" 1>&2 |
| 70 exit 0 |
| 71 fi |
| 72 |
67 # Don't "pull" if checkout is not on a named branch | 73 # Don't "pull" if checkout is not on a named branch |
68 shift | 74 shift |
69 if test "$2" = "pull" && ( ! git symbolic-ref HEAD >/dev/null 2>/dev/null ); t
hen | 75 if test "$2" = "pull" && ( ! git symbolic-ref HEAD >/dev/null 2>/dev/null ); t
hen |
70 first_args="$1 fetch" | 76 first_args="$1 fetch" |
71 else | 77 else |
72 first_args="$1 $2" | 78 first_args="$1 $2" |
73 fi | 79 fi |
74 shift 2 | 80 shift 2 |
75 $first_args $@ | sed "s/^/[$solution] /g" 1>&2 | 81 $first_args $@ | sed "s/^/[$solution] /g" 1>&2 |
76 if [ $? -ne 0 ]; then | 82 if [ $? -ne 0 ]; then |
(...skipping 11 matching lines...) Expand all Loading... |
88 submodule="${1#*/}" | 94 submodule="${1#*/}" |
89 echo "[$solution] updating $submodule" | 95 echo "[$solution] updating $submodule" |
90 "$GIT_EXE" submodule update --quiet "$submodule" | | 96 "$GIT_EXE" submodule update --quiet "$submodule" | |
91 ( grep -v '^Skipping submodule' || true ) | sed "s|^|[$1] |g" | 97 ( grep -v '^Skipping submodule' || true ) | sed "s|^|[$1] |g" |
92 status=$? | 98 status=$? |
93 if [ "$status" -ne "0" ]; then | 99 if [ "$status" -ne "0" ]; then |
94 echo "[$solution] FAILED to update $submodule" | 100 echo "[$solution] FAILED to update $submodule" |
95 fi | 101 fi |
96 fi | 102 fi |
97 exit $status | 103 exit $status |
OLD | NEW |