set -e
-function darcs_import()
-{
- [ -x "`which darcs`" ] || return
- REPODIR=$1
- ORIGIN=$2
- if [ ! -d ${REPODIR}/_darcs ]; then
- darcs get ${ORIGIN} --repo-name=${REPODIR}
- else
- (cd ${REPODIR}; darcs pull --all ${ORIGIN})
- fi
-}
cd `dirname $0`
-MYDIR=$PWD
+export MYDIR=$PWD
########################################
# Update submodules
########################################
cd `git rev-parse --show-cdup`
-git submodule init
-git submodule update
-
-for dir in `git submodule status|awk '{print $2}'`; do
- export dir
- (
- cd $dir
- git submodule init
- git submodule update
- )
+
+# Register only submodules that can be checked out
+git config -f .gitmodules --get-regexp '^submodule\..*\.path$'|awk '{ print $2 }' |
+while read $path; do
+ if ! git submodule update --init -- "$path"; then
+ git config --remove-section "submodule.$path"
+ git checkout "$path"
+ fi
done
-########################################
-# Import PXMC
-########################################
-cd $MYDIR
-set +e
-# This can fail if you do not have sufficient rights
-darcs_import ../src/pxmc rtime.felk.cvut.cz:/var/repos/pxmc
-set -e
+# Update submodules of submodules (recursively)
+git submodule foreach $MYDIR/update_submodules
########################################
# Default config
########################################
+cd $MYDIR
for i in h8eurobot/ h8mirosot/ h8canusb/ linux/ ppc/ lpceurobot/; do
make -C $i default-config
done
--- /dev/null
+#!/bin/sh
+
+# Helper script called from prepare_infrastructure
+
+if [ -z "$MYDIR" ]; then
+ echo >&2 "Should only be called from prepare_infrastructure"
+ exit 1
+fi
+
+git submodule init
+git submodule update
+# Recurse to submodules
+git submodule foreach $MYDIR/update_submodules
+exit 0