All of lore.kernel.org
 help / color / mirror / Atom feed
* [tip:perf/core] perf tools: Handle --version string generation on machines without git
@ 2012-11-14  6:34 tip-bot for Arnaldo Carvalho de Melo
  0 siblings, 0 replies; only message in thread
From: tip-bot for Arnaldo Carvalho de Melo @ 2012-11-14  6:34 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, eranian, paulus, acme, hpa, mingo, peterz, efault,
	namhyung, jolsa, fweisbec, dsahern, tglx

Commit-ID:  688b2c2f17943d48bccbaad4c43430ee68c4c1cd
Gitweb:     http://git.kernel.org/tip/688b2c2f17943d48bccbaad4c43430ee68c4c1cd
Author:     Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Tue, 30 Oct 2012 13:44:40 -0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 31 Oct 2012 12:17:49 -0200

perf tools: Handle --version string generation on machines without git

If git is installed we'll have a 'perf --version' output of this form:

$ make -j8 -C tools/perf/ O=/home/acme/git/build/perf install
$ perf --version
perf version 3.7.rc3.g3afad6

Now on a machine without git installed:

$ mv  /home/acme/bin/git /home/acme/bin/git.OFF
$ make -j8 -C tools/perf/ O=/home/acme/git/build/perf install
$ perf --version
perf version 3.7.0-rc2

That is, no error message due to git not being installed will appear on the
screen and instead the version string in the top level Makefile will be
used.

Requested-by: Ingo Molnar <mingo@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-am6yp6phvxyjmyndxogpunjv@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/PERF-VERSION-GEN |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN
index ac418a1..6aa34e5 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)

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-14  6:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-14  6:34 [tip:perf/core] perf tools: Handle --version string generation on machines without git tip-bot for Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.