Add support for Git submodules

This commit is contained in:
Pierre Pronchery 2020-04-11 03:10:40 +02:00
parent 729f9a20df
commit a30b1f33e3

View File

@ -35,6 +35,7 @@ PROGNAME_GIT_DOC="deforaos-git-doc.sh"
CONFIGURE="/usr/local/bin/configure" CONFIGURE="/usr/local/bin/configure"
GIT="git" GIT="git"
GIT_CLONE="$GIT clone -q" GIT_CLONE="$GIT clone -q"
GIT_SUBMODULE="$GIT submodule -q"
MAKE="make" MAKE="make"
MKTEMP="mktemp" MKTEMP="mktemp"
RM="/bin/rm -f" RM="/bin/rm -f"
@ -59,6 +60,11 @@ _git_tests()
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "$repository: Could not clone" 1>&2 echo "$repository: Could not clone" 1>&2
elif [ -d "$tmpdir/repository/doc" ]; then elif [ -d "$tmpdir/repository/doc" ]; then
#update submodules if any
[ -f "$tmpdir/repository/.gitmodules" ] &&
(cd "$tmpdir/repository" &&
$GIT submodule init &&
$GIT submodule update)
#generate documentation if available #generate documentation if available
(cd "$tmpdir/repository" && (cd "$tmpdir/repository" &&
$CONFIGURE && $CONFIGURE &&