From: Theodore Ts'o Date: Sat, 3 Nov 2007 01:52:59 +0000 (-0400) Subject: kbuild: change CONFIG_LOCALVERSION_AUTO to use a git-describe-ish format X-Git-Tag: v2.6.25-rc1~1164^2~50 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=d882421f4e08ddf0a94245cdbe516db260aa6f41;p=linux-2.6-omap-h63xx.git kbuild: change CONFIG_LOCALVERSION_AUTO to use a git-describe-ish format Change the automatic local version to have the form -nnnnn-gSHA1SUMID, where 'nnnnn' is the number of commits since the last tag (i.e., 2.6.21-rc7). This makes it much more likely that the package names created for the kernel will look "newer" to a package manager. Signed-off-by: "Theodore Ts'o" Signed-off-by: Sam Ravnborg --- diff --git a/scripts/setlocalversion b/scripts/setlocalversion index a80d6ea8a5b..1b31da84367 100644 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion @@ -12,7 +12,7 @@ cd "${1:-.}" || usage if head=`git rev-parse --verify HEAD 2>/dev/null`; then # Do we have an untagged version? if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then - printf '%s%s' -g `echo "$head" | cut -c1-8` + git describe | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' fi # Are there uncommitted changes?