File tree Expand file tree Collapse file tree 5 files changed +19
-32
lines changed
Expand file tree Collapse file tree 5 files changed +19
-32
lines changed Original file line number Diff line number Diff line change @@ -17,3 +17,5 @@ if [ "$GIT_QUIET" = 0 ]; then
1717else
1818 GIT_QUIET=(--quiet)
1919fi
20+
21+ N_PARALLEL_UPDATE=" ${N_PARALLEL_UPDATE:- $NUMBER_OF_PROCESSORS } "
Original file line number Diff line number Diff line change 1616NAME=" ${1% .git} "
1717NAME=" ${NAME##*/ } "
1818
19- N_PARALLEL_UPDATE=" ${N_PARALLEL_UPDATE:- $NUMBER_OF_PROCESSORS } "
20-
2119git clone " ${GIT_QUIET[@]} " --branch " $2 " " $1 "
2220cd " $NAME "
2321git submodule " ${GIT_QUIET[@]} " update --init --jobs " $N_PARALLEL_UPDATE "
Original file line number Diff line number Diff line change 1616
1717git pull " ${GIT_QUIET[@]} " --rebase
1818
19- update-by-key () {
20- local KEY=" $1 "
21- local DIR
22- DIR=" $( git config --file .gitmodules --get " $KEY " ) "
23- git submodule " ${GIT_QUIET[@]} " update --init -- " $DIR "
24- }
19+ MODULES=()
20+ while IFS=' ' read -r line; do
21+ MODULES+=(" $line " )
22+ done < <( git config \
23+ --file .gitmodules \
24+ --get-regexp " ^submodule\.(equipment|requires)/.*\.path$" \
25+ | sed -e ' s#^.*\.path ##g' )
2526
26- for KEY in $( git config \
27- --file .gitmodules \
28- --name-only \
29- --get-regexp " ^submodule\.(equipment|requires)/.*\.path$" ) ; do
30- update-by-key " $KEY "
31- done
32-
33- update-by-key " submodule..cppsm.path"
27+ git submodule " ${GIT_QUIET[@]} " update --jobs " $N_PARALLEL_UPDATE " --init -- " ${MODULES[@]} "
Original file line number Diff line number Diff line change 1414 exit 1
1515fi
1616
17- upgrade-by-key () {
18- local KEY= " $1 "
19- local DIR
20- DIR= " $ ( git config --file .gitmodules --get " $KEY " ) "
21- git submodule " ${GIT_QUIET[@]} " update --remote -- " $DIR "
22- git add " $DIR "
23- }
17+ MODULES=()
18+ while IFS= ' ' read -r line ; do
19+ MODULES+=( " $line " )
20+ done < < ( git config \
21+ --file .gitmodules \
22+ --get-regexp " ^submodule\.(equipment|requires)/.*\.path$ " \
23+ | sed -e ' s#^.*\.path ##g ' )
2424
25- for KEY in $( git config \
26- --file .gitmodules \
27- --name-only \
28- --get-regexp " ^submodule\.(equipment|requires)/.*\.path$" ) ; do
29- upgrade-by-key " $KEY "
30- done
31-
32- upgrade-by-key " submodule..cppsm.path"
25+ git submodule " ${GIT_QUIET[@]} " update --jobs " $N_PARALLEL_UPDATE " --remote -- " ${MODULES[@]} "
26+ git add " ${MODULES[@]} "
3327
3428" $CPPSM /commands/init"
Original file line number Diff line number Diff line change @@ -55,7 +55,6 @@ folded() {
5555 echo -e " \ntravis_fold:end:cppsm.$FOLD \r"
5656}
5757
58- N_PARALLEL_UPDATE=" ${N_PARALLEL_UPDATE:- $NUMBER_OF_PROCESSORS } "
5958folded ... concurrently GIT_UPDATE_PID git submodule update --init --depth 1 --jobs " $N_PARALLEL_UPDATE "
6059
6160if [ " $TRAVIS_OS_NAME " = linux ]; then
You can’t perform that action at this time.
0 commit comments