diff options
author | Gaetan Nadon <memsize@videotron.ca> | 2011-03-08 09:27:54 -0500 |
---|---|---|
committer | Gaetan Nadon <memsize@videotron.ca> | 2011-03-08 09:27:54 -0500 |
commit | b008617b99abb542401881b7152ecfc6cd4f2032 (patch) | |
tree | c41ff4de027e36400d76067d1a14c8b8f6f854b0 | |
parent | d8e51f238783e2a5bccae6b244b97db5cdbbbc60 (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-x | build.sh | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -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 |