git version generation fixes

- Remove the `version` file created for the tarball after the tarball is finished
- Use the builtin type instead of which.
This commit is contained in:
David Adam (zanchey) 2013-09-02 20:08:46 +08:00
parent cca60adc35
commit 8159f55243
2 changed files with 2 additions and 1 deletions

View File

@ -12,7 +12,7 @@ DEF_VER=2.0.GIT
if test -f version if test -f version
then then
VN=$(cat version) || VN="$DEF_VER" VN=$(cat version) || VN="$DEF_VER"
elif test -d .git -o -f .git && which git >/dev/null elif test -d .git -o -f .git && type git >/dev/null
then then
VN=$(git describe --tags --dirty 2>/dev/null) VN=$(git describe --tags --dirty 2>/dev/null)
else else

View File

@ -42,6 +42,7 @@ ln -s "$wd" "$prefix"
gnutar --append --file="$path" "$prefix"/user_doc/html gnutar --append --file="$path" "$prefix"/user_doc/html
gnutar --append --file="$path" "$prefix"/share/man gnutar --append --file="$path" "$prefix"/share/man
gnutar --append --file="$path" "$prefix"/version gnutar --append --file="$path" "$prefix"/version
rm -f "$prefix"/version
rm -f "$prefix" rm -f "$prefix"
# gzip it # gzip it