kumquat-buildroot/support/scripts
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
..
apply-patches.sh support/apply-patches: re-instate set -e 2016-07-06 14:47:30 +02:00
br2-external support/scripts: fix shebang with bash 2017-06-08 21:43:05 +02:00
brpkgutil.py graph-depends: rename pkgutil.py to brpkgutil.py 2017-03-21 23:11:04 +01:00
check-bin-arch support/scripts: fix shebang with bash 2017-06-08 21:43:05 +02:00
check-host-rpath support/scripts: check-host-rpath now handles $ORIGIN as well 2017-07-02 15:49:25 +02:00
check-kernel-headers.sh check-kernel-headers: mktemp --tmpdir not available on RedHat RHEL5 2014-09-28 20:40:57 +02:00
eclipse-register-toolchain
expunge-gconv-modules Change /bin/bash shebangs into /usr/bin/env bash 2014-10-25 01:55:37 +02:00
fix-configure-powerpc64.sh support/scripts: fix shebang with bash 2017-06-08 21:43:05 +02:00
genimage.sh support/scripts: fix shebang with bash 2017-06-08 21:43:05 +02:00
graph-build-time support/scripts: fix graph-build-time help text 2016-05-24 23:26:25 +02:00
graph-depends support/scripts: fix shebang with python 2017-06-07 21:55:10 +02:00
hardlink-or-copy support/scripts: fix shebang with bash 2017-06-08 21:43:05 +02:00
mkmakefile Makefile: Remove 'quiet' variable 2015-10-29 00:04:05 +01:00
mkusers support/scripts: allow /etc/shadow to be symlinked 2017-06-24 17:49:48 +02:00
pkg-stats tools: rename to 'utils' 2017-07-01 18:07:00 +02:00
pycompile.py pycompile: allow to force compilation 2017-03-20 23:00:25 +01:00
setlocalversion setlocalversion: fix detection of hg revision for untagged versions 2017-07-03 11:40:49 +02:00
size-stats size-stats: don't count hard links 2017-02-06 19:38:53 +01:00
xorg-release support/scripts: fix shebang with python 2017-06-07 21:55:10 +02:00