summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5a2282d)
raw | patch | inline | side by side (parent: 5a2282d)
author | H. Peter Anvin <hpa@zytor.com> | |
Tue, 10 Jan 2006 02:07:01 +0000 (18:07 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 10 Jan 2006 04:22:26 +0000 (20:22 -0800) |
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>
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>
GIT-VERSION-GEN | patch | blob | history | |
Makefile | patch | blob | history |
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 845b9dce6eaab80d011370f701c254a051027cc2..7763639a82bf7e2d4ccef8d2795b9e9dda197e9b 100755 (executable)
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
#!/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)
diff --git a/Makefile b/Makefile
index c9c15b5ff2255dbaa08dcde9e7b37080fef74cc3..fa0cd8315fcc855e84b8c409f88d5e1a910e8ef4 100644 (file)
--- a/Makefile
+++ b/Makefile
./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