lkml.org 
[lkml]   [2013]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: perf version not set when building out of tree
On 11/1/13, 1:02 AM, Ingo Molnar wrote:
> I think we should pack the PERF-VERSION-FILE with the tarball and
> use that. This needs roughly 3 changes:
>
> - make PERF-VERSION-FILE part of the tarball
> - make sure it's not zapped on 'make clean'
> - don't try to regenerate it if there's no git repository to get a version from

Solution was actually kind of easy. The head commit is already saved to
HEAD file when the tar is generated:

diff --git a/perf/tools/perf/util/PERF-VERSION-GEN
b/perf/tools/perf/util/PERF-VERSION-GEN
index 15a77b7c0e36..2155882e7c1d 100755
--- a/perf/tools/perf/util/PERF-VERSION-GEN
+++ b/perf/tools/perf/util/PERF-VERSION-GEN
@@ -19,6 +19,9 @@ if test -d ../../.git -o -f ../../.git
then
TAG=$(git describe --abbrev=0 --match "v[0-9].[0-9]*" 2>/dev/null )
CID=$(git log -1 --abbrev=4 --pretty=format:"%h" 2>/dev/null) &&
CID="-g$CID"
+elif test -f ../../HEAD
+then
+ TAG=$(cat ../../HEAD)
fi
if test -z "$TAG"
then
David


\
 
 \ /
  Last update: 2013-11-06 01:21    [W:0.062 / U:0.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site