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

Unified Diff: crup-runner.sh

Issue 13831004: Allow multiple OSes to be checked out with git submodules. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: address nit Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crup-runner.sh
diff --git a/crup-runner.sh b/crup-runner.sh
index 7c7947c13496587352a8e44e658c8f4f31c71936..4765a2f519ed83a0a7b740a289887f34463263c6 100755
--- a/crup-runner.sh
+++ b/crup-runner.sh
@@ -18,7 +18,7 @@ update_toplevel () {
set_target_os () {
# Get the os we're building for. On first run, this will be unset.
- target_os=$(git config target.os 2>/dev/null)
+ target_os=$(git config --get-all target.os 2>/dev/null)
if [ -z "$target_os" ]; then
case $(uname -s) in
Linux) target_os=unix ;;
@@ -55,14 +55,19 @@ process_submodule () {
update_policy=$(git config --get "submodule.$1.update")
if [ -z "$update_policy" ]; then
submod_os=$(git config -f .gitmodules --get "submodule.$1.os")
- if [ -n "$submod_os" -a \
- "$submod_os" != "all" -a \
- "${submod_os/${target_os}/}" = "${submod_os}" ]; then
+ if [ -n "$submod_os" -a "$submod_os" != "all" ]; then
update_policy=none
+ for os in $target_os; do
+ if [ "${submod_os/${os}/}" != "${submod_os}" ]; then
+ update_policy=checkout
+ fi
+ done
else
- git submodule --quiet init "$1"
update_policy=checkout
fi
+ if [ "$update_policy" != "none" ]; then
+ git submodule --quiet init "$1"
+ fi
git config "submodule.$1.update" $update_policy
fi
ignore_policy=$(git config --get "submodule.$1.ignore")
« 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