summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtools/perf/util/PERF-VERSION-GEN3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN
index ac418a1255e6..6aa34e5afdcf 100755
--- a/tools/perf/util/PERF-VERSION-GEN
+++ b/tools/perf/util/PERF-VERSION-GEN
@@ -14,8 +14,9 @@ LF='
# otherwise try to get the version from the kernel Makefile
#
if test -d ../../.git -o -f ../../.git &&
- VN=$(echo $(git tag -l "v[0-9].[0-9]*" | tail -1)"-g"$(git log -1 --abbrev=4 --pretty=format:"%h" HEAD) 2>/dev/null)
+ 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)