]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
PXMC added as git submodule
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 25 Feb 2009 08:15:29 +0000 (09:15 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 25 Feb 2009 08:15:29 +0000 (09:15 +0100)
prepare_infrastructure script was modified to initialize only submodules
that can be checked out

.gitignore
.gitmodules
build/prepare_infrastructure
build/update_submodules [new file with mode: 0755]
src/pxmc [new submodule]

index f3291f84e8bbbbda19b366175b0d497f09d9dc4c..27392b957c9ec174a59bb45e6222c120eb95fcbe 100644 (file)
@@ -9,7 +9,6 @@ _infrastructure
 *.pyc
 cscope.files
 cscope.out
-src/pxmc
 *.mexglx
 *.kdevelop
 *.kdevelop.filelist
index 782247b45372dfbd37e14a32dc5e68601b218f1a..6be167f6c64ee7bf4120781e16f2f610dfbcc2d1 100644 (file)
@@ -10,3 +10,6 @@
 [submodule "robot-root"]
        path = robot-root
        url = ./robot-root.git
+[submodule "src/pxmc"]
+       path = src/pxmc
+       url = git://rtime.felk.cvut.cz/pxmc.git
index 67d13cc56d0a8325b663f1776acebe6b82db3fa9..dfd507c2edd1b026801210899dc5b19ffdab8d2d 100755 (executable)
@@ -2,49 +2,31 @@
 
 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
diff --git a/build/update_submodules b/build/update_submodules
new file mode 100755 (executable)
index 0000000..cf95e1f
--- /dev/null
@@ -0,0 +1,14 @@
+#!/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
diff --git a/src/pxmc b/src/pxmc
new file mode 160000 (submodule)
index 0000000..15182fd
--- /dev/null
+++ b/src/pxmc
@@ -0,0 +1 @@
+Subproject commit 15182fd401ce80601f8958ee650e70535369d12b