lkml.org 
[lkml]   [2012]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf tools: Speed up the perf build time by simplifying the perf --version string generation
Em Tue, Oct 30, 2012 at 10:48:52AM +0100, Ingo Molnar escreveu:
>
> * Ingo Molnar <mingo@kernel.org> wrote:
>
> > Does -l work?
> >
> > Alternatively, please replace:
> >
> > git tag --list "v[0-9].[0-9]*" | tail -1
> >
> > with:
> >
> > git tag | tail -1 | grep -E "v[0-9].[0-9]*"
> >
> > which is just as fast.
>
> make that:
>
> git tag 2>/dev/null | tail -1 | grep -E "v[0-9].[0-9]*"
>
> this will work silently even if Git is not installed.

But we first check if we have a .git, that doesn't guarantees that git
is installed, but makes it a lot likely, no? Redirecting stderr to null
would need to be done in more places, so we would need to use something
like what we do for xmlto/asciidoc, $(call get-executable,$(GIT))

#
# First check if there is a .git to get the version from git describe
# 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)
then
VN=$(echo "$VN" | sed -e 's/-/./g');
else
VN=$(MAKEFLAGS= make -sC ../.. kernelversion)
fi


\
 
 \ /
  Last update: 2012-10-30 11:41    [W:0.158 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site