Skip to content

Commit

Permalink
perf tools: Version incorrect with some versions of grep
Browse files Browse the repository at this point in the history
Some versions of grep don't treat '\s' properly. When building perf on such
systems and using a kernel tarball the perf version is unable to be determined
from the main kernel Makefile and the user is left with a version of '..'.
Replacing the use of '\s' with '[[:space:]]', which should work in all grep
versions, gives a usable version number.

Reported-by: Tapan Dhimant <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Tapan Dhimant <[email protected]>
Cc: [email protected]
Cc: [email protected]
LKML-Reference: <[email protected]>
Signed-off-by: Josh Hunt <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
geauxbears authored and acmel committed Mar 16, 2011
1 parent 38b435b commit 58d406e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/perf/util/PERF-VERSION-GEN
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ if test -d ../../.git -o -f ../../.git &&
then
VN=$(echo "$VN" | sed -e 's/-/./g');
else
eval `grep '^VERSION\s*=' ../../Makefile|tr -d ' '`
eval `grep '^PATCHLEVEL\s*=' ../../Makefile|tr -d ' '`
eval `grep '^SUBLEVEL\s*=' ../../Makefile|tr -d ' '`
eval `grep '^EXTRAVERSION\s*=' ../../Makefile|tr -d ' '`
eval $(grep '^VERSION[[:space:]]*=' ../../Makefile|tr -d ' ')
eval $(grep '^PATCHLEVEL[[:space:]]*=' ../../Makefile|tr -d ' ')
eval $(grep '^SUBLEVEL[[:space:]]*=' ../../Makefile|tr -d ' ')
eval $(grep '^EXTRAVERSION[[:space:]]*=' ../../Makefile|tr -d ' ')

VN="${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION}"
fi
Expand Down

0 comments on commit 58d406e

Please sign in to comment.