[PATCH weston v2] Makefile: Fix compilation error when git commit message has quotes
Bryce Harrington
bryce at osg.samsung.com
Thu Apr 7 17:56:23 UTC 2016
On Thu, Apr 07, 2016 at 04:53:31PM +0000, Chokshi, Mitul wrote:
>
> A double-quote in log message prematurely ends the enquoted string
> in src/git-version.h, causing an error during compilation.
> Used stream editor to replace " with \"
>
> Signed-off-by: Mitul Chokshi <mitul.chokshi at intel.com>
> ---
> Makefile.am | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index d1644ac..a09ea0b 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -162,7 +162,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)' | $(SED) 's|\"|\\\"|g' )\"" > $@
> else
> src/git-version.h :
> $(AM_V_GEN)echo "#define BUILD_ID \"unknown (not built from git or tarball)\"" > $@
Confirmed:
$ echo "foo" >> README
$ git commit README -m "testing \""
$ make
make all-am
make[1]: Entering directory `/home/bryce/src/Wayland/weston'
/bin/bash: -c: line 0: syntax error near unexpected token `('
/bin/bash: -c: line 0: `echo " GEN " src/git-version.h;echo "#define BUILD_ID \"1.9.0-168-gb1f52e1 testing " (2016-04-07 10:53:15 -0700)\"" > src/git-version.h'
make[1]: *** [src/git-version.h] Error 1
make[1]: Leaving directory `/home/bryce/src/Wayland/weston'
make: *** [all] Error 2
With the patch applied, the make passes properly.
Tested-by: Bryce Harrington <bryce at osg.samsung.com>
> --
> 1.9.1
> > --------------------------------------------------------------
> Intel Research and Development Ireland Limited
> Registered in Ireland
> Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
> Registered Number: 308263
>
>
> This e-mail and any attachments may contain confidential material for the sole
> use of the intended recipient(s). Any review or distribution by others is
> strictly prohibited. If you are not the intended recipient, please contact the
> sender and delete all copies.
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list