@matheusbsbs / matheus-bagliano / commits / 181129d24c
Fork 0

For release tarballs, include the proper version

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>

H. Peter Anvin committed Jan 9, 2006 at 18:07 UTC 181129d24c83bfcbaa438579c5d3cd2531755232
2 files changed +11 -3
GIT-VERSION-GEN
+8 -2
@@ -1,9 +1,15 @@
1 #!/bin/sh
2
3 GVF=GIT-VERSION-FILE
4 +DEF_VER=v1.1.GIT
5
5 -VN=$(git-describe --abbrev=4 HEAD 2>/dev/null) || VN=v1.0.GIT
6 -VN=$(expr "$VN" : v'\(.*\)')
6 +# First try git-describe, then see if there is a version file
7 +# (included in release tarballs), then default
8 +VN=$(git-describe --abbrev=4 HEAD 2>/dev/null) ||
9 +VN=$(cat version) ||
10 +VN="$DEF_VER"
11 +
12 +VN=$(expr "$VN" : v*'\(.*\)')
13 if test -r $GVF
14 then
15 VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)
Makefile
+3 -1
@@ -489,7 +489,9 @@ dist: git.spec git-tar-tree
489 ./git-tar-tree HEAD $(GIT_TARNAME) > $(GIT_TARNAME).tar
490 @mkdir -p $(GIT_TARNAME)
491 @cp git.spec $(GIT_TARNAME)
492 - $(TAR) rf $(GIT_TARNAME).tar $(GIT_TARNAME)/git.spec
492 + @echo $(GIT_VERSION) > $(GIT_TARNAME)/version
493 + $(TAR) rf $(GIT_TARNAME).tar \
494 + $(GIT_TARNAME)/git.spec $(GIT_TARNAME)/version
495 @rm -rf $(GIT_TARNAME)
496 gzip -f -9 $(GIT_TARNAME).tar
497