summaryrefslogtreecommitdiffstats
path: root/version.sh
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2011-02-19 19:01:07 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2011-02-19 19:07:12 +0200
commite786c70de9a65c44f575ab8c61ff00fbbd2df585 (patch)
tree271263506248179c72496c5d2aa7f9c729a62335 /version.sh
parentd9c79b7dc6748a534ff370ecf52fc747084b9625 (diff)
downloadmpv-e786c70de9a65c44f575ab8c61ff00fbbd2df585.tar.bz2
mpv-e786c70de9a65c44f575ab8c61ff00fbbd2df585.tar.xz
build: change version number generation
Force Makefile to always run version.sh to potentially regenerate version.h. Drop compiler version and 'git-' prefix from version number. Match only git tags starting 'v'+number when generating version number; leave the 'v' out from the result.
Diffstat (limited to 'version.sh')
-rwxr-xr-xversion.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/version.sh b/version.sh
index 193645b859..aaf6c1cfaa 100755
--- a/version.sh
+++ b/version.sh
@@ -5,8 +5,8 @@ test "$1" && extra="-$1"
# Extract revision number from file used by daily tarball snapshots
# or from "git describe" output
git_revision=$(cat snapshot_version 2> /dev/null)
-test $git_revision || test ! -d .git || git_revision=`git describe --always`
-test $git_revision && git_revision=git-$git_revision
+test $git_revision || test ! -d .git || git_revision=`git describe --match "v[0-9]*" --always`
+git_revision=$(expr "$git_revision" : v*'\(.*\)')
test $git_revision || git_revision=UNKNOWN
# releases extract the version number from the VERSION file