Re: Versioning of tree

Sam Ravnborg
2004-10-26T17:09:06Z

On Tue, Oct 26, 2004 at 08:26:33AM -0400, Ryan Anderson wrote:
> On Tue, Oct 26, 2004 at 12:49:02PM +0100, David Vrabel wrote:
> > Ryan Anderson wrote:
> > >
> > >Well, here's a patch that adds -BKxxxxxxxx to LOCALVERSION when a
> > >top-level BitKeeper tree is detected.
> > >[...]
> > > LOCALVERSION = $(subst $(space),, \
> > > $(shell cat /dev/null $(localversion-files)) \
> > >+ $(subst ",,$(localversion-bk)) \
> >
> > Surely there's no need for this? Can't the script spit out an
> > appropriate localversion* file instead?
>
> It can, and yes, my first version used that method.
>
> Except it never worked. I was able to generate the file before
> include/linux/version.h was rebuilt, but failed to get it picked up in
> that. I'm not really sure why.

The $(wildcard ...) function was executed before you created the file.
If we shall retreive the version from a SCM then as you already do
must hide it in a script.
I want the script only to be executed when we actually ask kbuild to
build a kernel - so it has to be part of the prepare rule set.
Furthermore I like to avoid a dependency on perl for a basic kernel.

Can you retreive the version from bk using a simple shell script?

Sam