Skip to content

Commit

Permalink
For release tarballs, include the proper version
Browse files Browse the repository at this point in the history
When producing a release tarball, include a "version" file, which
GIT-VERSION-GEN can then use to do the right thing when building from a
tarball.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
H. Peter Anvin authored and Junio C Hamano committed Jan 10, 2006
1 parent 5a2282d commit 181129d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 8 additions & 2 deletions GIT-VERSION-GEN
@@ -1,9 +1,15 @@
#!/bin/sh

GVF=GIT-VERSION-FILE
DEF_VER=v1.1.GIT

VN=$(git-describe --abbrev=4 HEAD 2>/dev/null) || VN=v1.0.GIT
VN=$(expr "$VN" : v'\(.*\)')
# First try git-describe, then see if there is a version file
# (included in release tarballs), then default
VN=$(git-describe --abbrev=4 HEAD 2>/dev/null) ||
VN=$(cat version) ||
VN="$DEF_VER"

VN=$(expr "$VN" : v*'\(.*\)')
if test -r $GVF
then
VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Expand Up @@ -489,7 +489,9 @@ dist: git.spec git-tar-tree
./git-tar-tree HEAD $(GIT_TARNAME) > $(GIT_TARNAME).tar
@mkdir -p $(GIT_TARNAME)
@cp git.spec $(GIT_TARNAME)
$(TAR) rf $(GIT_TARNAME).tar $(GIT_TARNAME)/git.spec
@echo $(GIT_VERSION) > $(GIT_TARNAME)/version
$(TAR) rf $(GIT_TARNAME).tar \
$(GIT_TARNAME)/git.spec $(GIT_TARNAME)/version
@rm -rf $(GIT_TARNAME)
gzip -f -9 $(GIT_TARNAME).tar

Expand Down

0 comments on commit 181129d

Please sign in to comment.