summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaetan Nadon <memsize@videotron.ca>2011-03-08 09:27:54 -0500
committerGaetan Nadon <memsize@videotron.ca>2011-03-08 09:27:54 -0500
commitb008617b99abb542401881b7152ecfc6cd4f2032 (patch)
treec41ff4de027e36400d76067d1a14c8b8f6f854b0
parentd8e51f238783e2a5bccae6b244b97db5cdbbbc60 (diff)
build.sh: add support for git submodules
Currently xcb/util is the first package to use a git submodule. When cloning, the script will init and update the submodule. Older versions of git do not have --recursive option for git clone. When using -p (pull rebase), the script will update the submodule. Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
-rwxr-xr-xbuild.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/build.sh b/build.sh
index 0a20a4d..b2d124b 100755
--- a/build.sh
+++ b/build.sh
@@ -309,6 +309,27 @@ clone() {
clonefailed_components="$clonefailed_components $module/$component"
return 1
fi
+ old_pwd=`pwd`
+ cd $DIR
+ if [ $? -ne 0 ]; then
+ echo "Failed to cd to $module module component $component. Ignoring."
+ clonefailed_components="$clonefailed_components $module/$component"
+ return 1
+ return 1
+ fi
+ git submodule init
+ if [ $? -ne 0 ]; then
+ echo "Failed to initialize $module module component $component submodule. Ignoring."
+ clonefailed_components="$clonefailed_components $module/$component"
+ return 1
+ fi
+ git submodule update
+ if [ $? -ne 0 ]; then
+ echo "Failed to update $module module component $component submodule. Ignoring."
+ clonefailed_components="$clonefailed_components $module/$component"
+ return 1
+ fi
+ cd ${old_pwd}
else
echo "git cannot clone into an existing directory $module/$component"
return 1
@@ -390,6 +411,12 @@ process() {
cd $old_pwd
return 1
fi
+ # The parent module knows which commit the submodule should be at
+ git submodule update
+ if [ $? -ne 0 ]; then
+ failed "git submodule update" $module $component
+ return 1
+ fi
fi
# Build outside source directory