kumquat-buildroot/support
Thomas De Schampheleire b17792236e 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>
(cherry picked from commit ec019bcf64)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2017-07-04 17:35:56 +02:00
..
dependencies Revert "dependencies/cmake: blacklist cmake 3.7" 2017-03-01 22:13:49 +01:00
download download/git: clarify why .git is removed 2017-04-20 22:27:23 +02:00
gnuconfig support/gnuconfig: bump version to 2016-05-15 2016-06-05 22:26:57 +02:00
kconfig merge_config.sh: create temporary files in /tmp 2016-01-31 09:09:52 +01:00
legal-info docs: libtool patches are not handled by legal-info infrastructure. 2016-08-19 23:16:23 +02:00
libtool support/libtool: add patch for newer versions 2014-12-21 13:21:56 +01:00
misc Update for 2017.05 2017-05-31 23:55:40 +02:00
scripts setlocalversion: fix detection of hg revision for untagged versions 2017-07-04 17:35:56 +02:00
testing support/testing: rename variables for readability 2017-05-28 14:54:43 +02:00