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 11:31:14 +0530
commit0e4ab6195b753adfcd57f023626727b3fc058306 (patch)
tree0fc3cb2d96c5b5f51dacdc3c7e739e99743085ee
parent70718db013643ef30e73c0c3c4e974684c1e1586 (diff)
kbuild: setlocalversion: ignore private tags while reporting local versionsamsung-lt-v3.6-rc5-1
The output of 'git describe' is relative to the immediate preceding tag. When the immediate tag preceding or at 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/setlocalversion5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index bd6dca8a0ab..b65e8a93df0 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -47,7 +47,7 @@ scm_version()
# If we are at a tagged commit (like "v2.6.30-rc6"), we ignore
# it, because this version is defined in the top level Makefile.
- if [ -z "`git describe --exact-match 2>/dev/null`" ]; then
+ if [ -z "`git describe --exact-match --match v[2-9].* 2>/dev/null`" ]; then
# If only the short version is requested, don't bother
# running further git commands
@@ -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}.