From: Johannes Schindelin Date: Wed, 14 Feb 2007 01:10:39 GMT Subject: Re: bug: build from tarball uses git-describe Message-ID: In-Reply-To: <7vd54dwnvb.fsf@assigned-by-dhcp.cox.net> Hi, On Tue, 13 Feb 2007, Junio C Hamano wrote: > Johannes Schindelin writes: > > > Does this (totally untested) patch help? > > > > -- > > > > GIT-VERSION-GEN | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN > > index 7a10b60..e6f89cb 100755 > > --- a/GIT-VERSION-GEN > > +++ b/GIT-VERSION-GEN > > @@ -8,7 +8,7 @@ LF=' > > > > # First try git-describe, then see if there is a version file > > # (included in release tarballs), then default > > -if VN=$(git describe --abbrev=4 HEAD 2>/dev/null) && > > +if test -d .git && VN=$(git describe --abbrev=4 HEAD 2>/dev/null) && > > case "$VN" in > > *$LF*) (exit 1) ;; > > v[0-9]*) : happy ;; > > Have you checked what the elif part does in the if statement you > are patching? It checks if the file "version" exists, and takes the contents of that as version, otherwise $DEF_VER. > After all fresh tarball is how we build rpm packages and we do > not have .git in that build environment, so I am quite puzzled. Yes, the idea was: if there is no .git, do not even bother checking the output of git-describe (it might find a .git directory in a parent directory, after all). Ciao, Dscho