diff options
author | Emil Velikov <emil.velikov@collabora.com> | 2017-02-14 11:38:20 +0000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2017-02-20 10:16:37 +1000 |
commit | 4fc573e2f3cbbed7baa5e05fb798c2e4f4236f7d (patch) | |
tree | c4651509a3cd8cdd26bf2d5d994f94e9a9472f4e /xorgversion.m4 | |
parent | 4b6b1dfea16214b5104b5373341dc8bc7016d0b5 (diff) |
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 <memsize@videotron.ca>
Cc: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xorgversion.m4')
-rw-r--r-- | xorgversion.m4 | 7 |
1 files changed, 4 insertions, 3 deletions
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 |