[Xcb] [PATCH] autogen.sh: verify that git submodules are initialized

Josh Triplett josh at joshtriplett.org
Sun Oct 28 14:13:16 PDT 2012


On Sun, Oct 28, 2012 at 01:49:54PM +0100, Michael Stapelberg wrote:
> From a3f35127ba8beb6a21e5305d03df7a75bc6a942d Mon Sep 17 00:00:00 2001
> From: Michael Stapelberg <michael at stapelberg.de>
> Date: Wed, 10 Oct 2012 09:09:38 +0200
> Subject: [PATCH] autogen.sh: verify that git submodules are initialized
> 

Reviewed-by: Josh Triplett <josh at joshtriplett.org>

> ---
>  autogen.sh |   15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/autogen.sh b/autogen.sh
> index 904cd67..afe5299 100755
> --- a/autogen.sh
> +++ b/autogen.sh
> @@ -6,6 +6,21 @@ test -z "$srcdir" && srcdir=.
>  ORIGDIR=`pwd`
>  cd $srcdir
>  
> +# If this is a git checkout, verify that the submodules are initialized,
> +# otherwise autotools will just fail with an unhelpful error message.
> +if [ -d ".git" ] && [ -r ".gitmodules" ]
> +then
> +	# If git is not in PATH, this will not return 0, thus not keeping us
> +	# from building. Since the message is worthless when git is not
> +	# installed, this is what we want.
> +	if git submodule status 2>/dev/null | grep -q '^-'
> +	then
> +		echo "You have uninitialized git submodules." >&2
> +		echo "Please run: git submodule update --init" >&2
> +		exit 1
> +	fi
> +fi
> +
>  autoreconf -v --install || exit 1
>  cd $ORIGDIR || exit $?
>  
> -- 
> 1.7.10.4
> 



More information about the Xcb mailing list