diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 4d403844e13..2c528664fb8 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion @@ -55,16 +55,17 @@ scm_version() echo "+" return 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 - echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' - - # If we don't have a tag at all we print -g{commitish}. - else - printf '%s%s' -g $head - fi fi + # If we are past a tagged commit (like + # "v2.6.30-rc5-302-g72357d5"), we pretty print it but strip + # off the v2.6.30-rc5 part because that's in the Makefile. + if atag="`git describe 2>/dev/null`"; then + atag="-${atag/v$KERNELVERSION-/}" + # If we don't have a tag at all we print -g{commitish}. + else + atag="-g$head" + fi + printf '%s' "$atag" # Is this git on svn? if git config --get svn-remote.svn.url >/dev/null; then