Bruno Haible <bruno <at> clisp.org> writes: > > Eric Blake wrote: > > it is not GNUmakefile that is wrong, it is the fact that you are > > including git-version-gen but violating the requirements of git-version-gen. > > I disagree. git-version-gen does not have the requirement that a file > .tarball-version does exist. git-version-gen has the requirement that the > first argument that you pass it must exist. (gnulib-tool itself for example > passes /dev/null.)
Actually, that isn't right either. Rather, git-version-gen has the requirement that _IF_ the first argument does not exist as a file, or exists but does not have a valid version string, _THEN_ it must be invoked from within a VCS checkout in order to generate a valid string (in fact, the only advantage of requiring a first argument when run from a VCS tree is that you can get a usage message; we could make the first argument optional, in which case git-version- gen then requires being run within a VCS tree to generate a valid string). gnulib-tool could pass something other than /dev/null as the first argument, even something that does not exist, and it would still work, because it always invokes git-version-gen from within a VCS checkout. > > GNUmakefile passes the argument $(srcdir)/.tarball-version to git-version-gen > without testing whether this file exists or not. This is the bug IMO. What about this patch, then? It makes GNUmakefile avoid triggering an autoreconf if git-version-gen returns a version of UNKNOWN, which is the case in gnulib's testdir (you are not in a VCS tree, and you did not create .tarball- version). It is not the existence of '.tarball-version' that matters, so much as the response to git-version-gen's behavior when both its first argument and git-describe fail to come up with a version string. OK to apply? Also, should this be modified to print an INFO message warning the user if git-version-gen returned UNKNOWN (normally an important warning, but one which can be safely ignored in a gnulib-tool testdir)? >From eae87f2093161a83b3296520b02caad7ad5db642 Mon Sep 17 00:00:00 2001 From: Eric Blake <[EMAIL PROTECTED]> Date: Wed, 4 Jun 2008 16:03:13 -0600 Subject: [PATCH] Be tolerant of missing .tarball-version in gnulib-tool test dir. * top/GNUmakefile (_dummy): Don't reconfigure if git-version-gen reported UNKNOWN. Reported by Simon Josefsson. Signed-off-by: Eric Blake <[EMAIL PROTECTED]> --- ChangeLog | 7 +++++++ top/GNUmakefile | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19792e6..da9a481 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-04 Eric Blake <[EMAIL PROTECTED]> + + Be tolerant of missing .tarball-version in gnulib-tool test dir. + * top/GNUmakefile (_dummy): Don't reconfigure if git-version-gen + reported UNKNOWN. + Reported by Simon Josefsson. + 2008-06-03 Bruno Haible <[EMAIL PROTECTED]> * lib/file-has-acl.c (file_has_acl): Put Solaris 10 code after POSIX- diff --git a/top/GNUmakefile b/top/GNUmakefile index 0c1bc38..3616c30 100644 --- a/top/GNUmakefile +++ b/top/GNUmakefile @@ -59,9 +59,11 @@ ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL)) _curr-ver := $(shell cd $(srcdir) && ./$(_build-aux)/git-version-gen \ $(srcdir)/.tarball-version) ifneq ($(_curr-ver),$(VERSION)) - $(info INFO: running autoreconf for new version string: $(_curr-ver)) - _dummy := $(shell cd $(srcdir) && rm -rf autom4te.cache .version \ - && $(_autoreconf)) + ifneq ($(_curr-ver),UNKNOWN) + $(info INFO: running autoreconf for new version string: $(_curr-ver)) + _dummy := $(shell cd $(srcdir) && rm -rf autom4te.cache .version \ + && $(_autoreconf)) + endif endif endif endif -- 1.5.5.1