aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTushar Behera <tushar.behera@linaro.org>2012-09-11 17:01:51 +0530
committerTushar Behera <tushar.behera@linaro.org>2012-09-12 10:18:42 +0530
commit2b94eb6f918742195de0708130a59cb8ada8919c (patch)
treeb226ae2a8bb07ab2097976fae295ad82261ba1b0
parent04601f9a2b5b3f34eff76cf39263eabb233948e4 (diff)
kbuild: setlocalversion: ignore private tags while reporting local version+
The output 'git describe' is relative to the immediate preceding tag. When the immediate tag preceding the HEAD is a private tag, setlocalversion extracts information with respect to the private tag and wrongly reports them with respect to Linux tag. Fixing this to extract information with respect to Linux tags. CC: Michal Marek <mmarek@suse.cz> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
-rwxr-xr-xscripts/setlocalversion3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index bd6dca8a0ab..d2c857c554b 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -57,7 +57,8 @@ scm_version()
fi
# If we are past a tagged commit (like
# "v2.6.30-rc5-302-g72357d5"), we pretty print it.
- if atag="`git describe 2>/dev/null`"; then
+ # Also match linux tags pattern to discard private tags
+ if atag="`git describe --match v[2-9].* 2>/dev/null`"; then
echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
# If we don't have a tag at all we print -g{commitish}.