Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Let repotool deal with submoules.
  • Loading branch information
inducer committed Aug 5, 2011
1 parent 0edf5df commit 08b1556
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions repotool
Expand Up @@ -5,7 +5,7 @@ set -e
function list_all_repos()
{
cat subprojects
if test -f extra-subprojects; then
if test -f extra-subprojects; then
cat extra-subprojects
fi
}
Expand Down Expand Up @@ -43,7 +43,7 @@ function show_help()


DIR=`dirname "$0"`
MYDIR=$(cd "$DIR" && pwd)
MYDIR=$(cd "$DIR" && pwd)

CMD="$1"
shift
Expand All @@ -59,7 +59,7 @@ case "$CMD" in

for-* )
TP=${CMD##for-}
if test "$1" = "-v"; then
if test "$1" = "-v"; then
shift
VERBOSE=1
fi
Expand Down Expand Up @@ -88,15 +88,16 @@ case "$CMD" in
) < .gitignore > new-gitig
mv new-gitig .gitignore
;;

clone | pull )
BASE_URL="$1"
SUFFIX="$2"
BRANCH="${3:-master}"
for n in `list_all_repos`; do
if ! test -d $n; then
if ! test -d $n; then
emphasize "CLONE $n"
git clone --quiet $BASE_URL$n$SUFFIX
(cd $n && git submodule update && git submodule update )
else
( cd $n
if test "$(git status | head -n 1)" != "# On branch master"; then
Expand All @@ -113,7 +114,15 @@ case "$CMD" in
fi
emphasize "PULL $n"
if ! git pull $BASE_URL$n$SUFFIX $BRANCH ; then
emphasize "PULL IN $n FAILED"
emphasize "PULL IN $n FAILED"
exit 1
fi
if ! git submodule init; then
emphasize "SUBMODULE INIT IN $n FAILED"
exit 1
fi
if ! git submodule update; then
emphasize "SUBMODULE UPDATE IN $n FAILED"
exit 1
fi
) || exit 1
Expand Down Expand Up @@ -143,7 +152,7 @@ case "$CMD" in
if test -e setup.py ; then
$PREFIX rm -Rf build *.egg-info dist
fi
)
)
done
;;

Expand All @@ -155,8 +164,8 @@ case "$CMD" in
cd $n
if test -e setup.py; then
emphasize "INSTALLING $n"
if ! $PY_COMMAND setup.py $CMD ; then
emphasize "COMMAND $CMD ON $n FAILED!"
if ! $PY_COMMAND setup.py $CMD ; then
emphasize "COMMAND $CMD ON $n FAILED!"
exit 1
fi
fi
Expand Down

0 comments on commit 08b1556

Please sign in to comment.