setlocalversion: fix version for untaged nontip mercurial revs
authorMilton Miller <miltonm@bga.com>
Thu, 22 Jul 2010 15:19:38 +0000 (10:19 -0500)
committerMichal Marek <mmarek@suse.cz>
Thu, 12 Aug 2010 22:52:14 +0000 (00:52 +0200)
The manpage for cut says it will return all lines without the delimiter
unless -s is specified.

When I backed up my mecurial tree to generate modules, I found that the
scm part of localversion was turning up blank.

Signed-off-by: Milton Miller <miltonm@bga.com>
Cc: Michal Marek <mmarek@suse.cz>
Cc: "Michał Górny" <gentoo@mgorny.alt.pl>
Signed-off-by: Michal Marek <mmarek@suse.cz>
scripts/setlocalversion

index 64a9cb5556cd0f90dab503c6b8cd96e2fa7bff1d..e90a91cc5185709d31a9a128b4790b676a35599e 100755 (executable)
@@ -86,7 +86,7 @@ scm_version()
 
        # Check for mercurial and a mercurial repo.
        if hgid=`hg id 2>/dev/null`; then
-               tag=`printf '%s' "$hgid" | cut -d' ' -f2`
+               tag=`printf '%s' "$hgid" | cut -s -d' ' -f2`
 
                # Do we have an untagged version?
                if [ -z "$tag" -o "$tag" = tip ]; then