From 4fc573e2f3cbbed7baa5e05fb798c2e4f4236f7d Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Tue, 14 Feb 2017 11:38:20 +0000 Subject: Rework CHANGELOG_CMD to touch/echo >&2 only as needed Currently CHANGELOG_CMD issues a touch ChangeLog; echo "Scary message" >&2 even if the file is already present. For example, when running `make distcheck' the following is observed: " /bin/sh: ../../.changelog.tmp: Permission denied git directory not found: installing possibly empty changelog. ... /bin/sh: ../../.changelog.tmp: Permission denied git directory not found: installing possibly empty changelog. " That in itself happens since srcdir is RO, thus shell redirection [to srcddir/.changelog.tmp] fails. At the same time the latter message is wrong and misleading since the file is already there, with the correct contents. Silence the permissing warning (/dev/null is our friend), and add a simple `test -e .../ChangeLog || (...' prior to the touch/echo combo. As we're here also update the message to be more generic, since there are multiple other reasons why things can fail. Cc: Gaetan Nadon Cc: Peter Hutterer Signed-off-by: Emil Velikov Signed-off-by: Peter Hutterer --- xorgversion.m4 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'xorgversion.m4') diff --git a/xorgversion.m4 b/xorgversion.m4 index 19f2ffd..8d9b634 100644 --- a/xorgversion.m4 +++ b/xorgversion.m4 @@ -56,9 +56,10 @@ AC_DEFUN([XORG_RELEASE_VERSION],[ # # AC_DEFUN([XORG_CHANGELOG], [ -CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ +CHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \ mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ -|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ -echo 'git directory not found: installing possibly empty changelog.' >&2)" +|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \ +touch \$(top_srcdir)/ChangeLog; \ +echo 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))" AC_SUBST([CHANGELOG_CMD]) ]) # XORG_CHANGELOG -- cgit v1.2.1