Commit Graph

4 Commits

Author SHA1 Message Date
Thomas De Schampheleire
ec019bcf64 setlocalversion: fix detection of hg revision for untagged versions
By default, cut prints the entire line if the specified delimiter is not
present at all:

    $ printf "foo bar" | cut -d' ' -f2
    bar
    $ printf "foobar" | cut -d' ' -f2
    foobar

In setlocalversion, cut is presented with the output of 'hg id' which has
the format:

    "<revision> <tags-if-any>"

If the current revision is not tagged, the output of 'hg id' does not
contain the delimiter (space), cut prints the entire string, and
setlocalversion thinks the version is the tag.
As setlocalversion does not print anything for tagged versions, there is no
output overall, and no correct indication of the mercurial revision.

Fix by passing the extra cut option '--only-delimited', which suppresses
output if no delimiter is found.

This problem likely went unnoticed for so long, because the tag 'tip' (i.e.
most recent revision of the branch) is treated specially: in this case the
mercurial revision _is_ printed, i.e. the situation is treated as
'untagged'.
The problem is only seen when you are _not_ at the most recent revision in
your branch.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2017-07-03 11:40:49 +02:00
Peter Korsgaard
33699aac06 setlocalversion: sync with Linux kernel version (2.6.34)
Brings a number of fixes, and most importantly no longer tries to figure
out if the tree contains uncommitted changes when using svn, as that can
be very slow.

This only syncs with setlocalversion as of 2.6.34 as later kernel versions
aren't directly compatible with our use cases since 09155120c (kbuild:
Clean up and speed up the localversion logic).

We still have one delta from the kernel version (setlocalversion: fix i18n
issue with svn), as that has only later been fixed in the kernel version.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-04 11:58:12 +02:00
Frederik Pasch
4861aed1f1 setlocalversion: fix i18n issue with svn
Closes #4700

Signed-off-by: Frederik Pasch <fpasch@googlemail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-01-16 13:54:57 +01:00
Thomas Petazzoni
f082c7c5cf support: move scripts/ to a new support/ directory
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-09-17 08:14:11 +02:00