[PATCH 1/1] build: handle special characters when building from git

Pekka Paalanen ppaalanen at gmail.com
Fri Aug 15 06:33:40 PDT 2014


On Wed, 30 Jul 2014 00:28:52 +0200
Manuel Bachmann <manuel.bachmann at open.eurogiciel.org> wrote:

> When building from a git repository, in Makefile.am, the
> macro creating the "src/git-version.h" file will fail
> if the last commit subject contains a special character
> such as ". Escape characters so that the output string
> is, at worst, empty.
> 
> Signed-off-by: Manuel Bachmann <manuel.bachmann at open.eurogiciel.org>
> ---
>  Makefile.am |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index 191dcc9..68f4d18 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -112,7 +112,7 @@ endif
>  
>  if HAVE_GIT_REPO
>  src/git-version.h : $(top_srcdir)/.git/logs/HEAD
> -	$(AM_V_GEN)echo "#define BUILD_ID \"$(shell git --git-dir=$(top_srcdir)/.git describe --always --dirty) $(shell git --git-dir=$(top_srcdir)/.git log -1 --format='%s (%ci)')\"" > $@
> +	$(AM_V_GEN)echo "#define BUILD_ID \"${(shell git --git-dir=$(top_srcdir)/.git describe --always --dirty)} ${(shell git --git-dir=$(top_srcdir)/.git log -1 --format='%s (%ci)')}\"" > $@
>  else
>  src/git-version.h :
>  	$(AM_V_GEN)echo "#define BUILD_ID \"unknown (not built from git or tarball)\"" > $@

For me, this just makes the BUILD_ID always empty, even without any
funny characters.


Thanks,
pq


More information about the wayland-devel mailing list