Skip to content

Commit d882421

Browse files
tytsosravnborg
authored andcommitted
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" <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]>
1 parent 22d6a6a commit d882421

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/setlocalversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cd "${1:-.}" || usage
1212
if head=`git rev-parse --verify HEAD 2>/dev/null`; then
1313
# Do we have an untagged version?
1414
if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
15-
printf '%s%s' -g `echo "$head" | cut -c1-8`
15+
git describe | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
1616
fi
1717

1818
# Are there uncommitted changes?

0 commit comments

Comments
 (0)