Messages in this thread Patch in this message |  | | Date | Tue, 05 Nov 2013 16:58:45 -0700 | From | David Ahern <> | Subject | Re: 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
|  |