[Buildroot] [PATCH 1/2] support/scripts/setlocalversion: fix detection of hg revision when _not_ on branch 'default'

Thomas Petazzoni thomas.petazzoni at bootlin.com
Mon Feb 4 20:24:42 UTC 2019


On Wed, 30 Jan 2019 21:15:07 +0100
Thomas De Schampheleire <patrickdepinguin at gmail.com> wrote:

> From: Thomas De Schampheleire <thomas.de_schampheleire at nokia.com>
> 
> When Buildroot is stored in a Mercurial repository on a branch other than
> 'default' ('master' in git terms), setlocalversion (used to populate
> /etc/os-release) will incorrectly think that this is a tagged version and
> will NOT print out the revision hash.
> 
> This is due to the fact that the output of 'hg id' is assumed to be
>     "<revision> <tags-if-any>"
> but when on a branch it actually is:
>     "<revision> (<branch>) <tags-if-any>"
> 
> To let setlocalversion receive the output it expects, explicitly ask 'hg id'
> to retrieve only the revision hash and any tags, ommitting any branch
> information.
> 
> Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire at nokia.com>
> ---
>  support/scripts/setlocalversion | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Both applied to master. Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


More information about the buildroot mailing list