summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/PERF-VERSION-GEN
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2013-02-25 21:50:05 +0100
committerMichal Marek <mmarek@suse.cz>2013-02-25 21:51:57 +0100
commite3900e74f26fc924c8e9e2a922bd40369b0bb517 (patch)
tree6e868575d346032ba9408f350c6e5369e0e52b0d /tools/perf/util/PERF-VERSION-GEN
parent62dc989921df2a98d1a73aacd085abe941cb9828 (diff)
parent02f3e53a131c8aa3fe3c954058f1add5beeae621 (diff)
downloadlinux-e3900e74f26fc924c8e9e2a922bd40369b0bb517.tar.gz
linux-e3900e74f26fc924c8e9e2a922bd40369b0bb517.tar.bz2
linux-e3900e74f26fc924c8e9e2a922bd40369b0bb517.zip
Merge branch 'kbuild/rc-fixes' into kbuild/kconfig
There is one kconfig fix in the rc-fixes branch that I forgot to submit for 3.8, so let's add it to the kconfig branch for 3.9-rc1.
Diffstat (limited to 'tools/perf/util/PERF-VERSION-GEN')
-rwxr-xr-xtools/perf/util/PERF-VERSION-GEN14
1 files changed, 5 insertions, 9 deletions
diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN
index 95264f304179..6aa34e5afdcf 100755
--- a/tools/perf/util/PERF-VERSION-GEN
+++ b/tools/perf/util/PERF-VERSION-GEN
@@ -9,18 +9,14 @@ GVF=${OUTPUT}PERF-VERSION-FILE
LF='
'
+#
# First check if there is a .git to get the version from git describe
-# otherwise try to get the version from the kernel makefile
+# otherwise try to get the version from the kernel Makefile
+#
if test -d ../../.git -o -f ../../.git &&
- VN=$(git describe --match 'v[0-9].[0-9]*' --abbrev=4 HEAD 2>/dev/null) &&
- case "$VN" in
- *$LF*) (exit 1) ;;
- v[0-9]*)
- git update-index -q --refresh
- test -z "$(git diff-index --name-only HEAD --)" ||
- VN="$VN-dirty" ;;
- esac
+ VN=$(git tag 2>/dev/null | tail -1 | grep -E "v[0-9].[0-9]*")
then
+ VN=$(echo $VN"-g"$(git log -1 --abbrev=4 --pretty=format:"%h" HEAD))
VN=$(echo "$VN" | sed -e 's/-/./g');
else
VN=$(MAKEFLAGS= make -sC ../.. kernelversion)