perf hist: Make event__totals per hists
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / tools / perf / util / PERF-VERSION-GEN
blob49ece7921914a3fdc20ea02d56af193ab61a73f9
1 #!/bin/sh
3 if [ $# -eq 1 ] ; then
4 OUTPUT=$1
5 fi
7 GVF=${OUTPUT}PERF-VERSION-FILE
8 DEF_VER=v0.0.2.PERF
10 LF='
13 # First see if there is a version file (included in release tarballs),
14 # then try git-describe, then default.
15 if test -f version
16 then
17 VN=$(cat version) || VN="$DEF_VER"
18 elif test -d .git -o -f .git &&
19 VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
20 case "$VN" in
21 *$LF*) (exit 1) ;;
22 v[0-9]*)
23 git update-index -q --refresh
24 test -z "$(git diff-index --name-only HEAD --)" ||
25 VN="$VN-dirty" ;;
26 esac
27 then
28 VN=$(echo "$VN" | sed -e 's/-/./g');
29 else
30 VN="$DEF_VER"
33 VN=$(expr "$VN" : v*'\(.*\)')
35 if test -r $GVF
36 then
37 VC=$(sed -e 's/^PERF_VERSION = //' <$GVF)
38 else
39 VC=unset
41 test "$VN" = "$VC" || {
42 echo >&2 "PERF_VERSION = $VN"
43 echo "PERF_VERSION = $VN" >$GVF