diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-02 16:33:56 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-02 16:33:56 -0700 |
commit | 414772fa496273d1a93cefa6dab790f5fdf9de82 (patch) | |
tree | cdf96b513010ac6bfb02728bbb22906978af321c /scripts/setlocalversion | |
parent | 7e567b44e6c59ad8bec321afb03302ffb1e6dda6 (diff) | |
parent | b614a697dc17dff82f140d72d21a095f810fa7fb (diff) | |
download | linux-rt-414772fa496273d1a93cefa6dab790f5fdf9de82.tar.gz |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes:
kbuild, modpost: Check the section flags, to catch missing "ax"/"aw"
kbuild: fix comment in modpost.c
kbuild: fix scripts/setlocalversion with git
kbuild: fix Module.markers permission error under cygwin
docs: also clean index.html
kbuild: remove a tag file before it is regenerated
kbuild: "make prepare" should be "make modules_prepare"
kbuild: clean Module.markers and modules.order for out-of-tree modules
avr32: drop unused CLEAN_FILES
Diffstat (limited to 'scripts/setlocalversion')
-rwxr-xr-x | scripts/setlocalversion | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 47e75b69a2e9..32c8554f3946 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion @@ -10,13 +10,12 @@ cd "${1:-.}" || usage # Check for git and a git repo. if head=`git rev-parse --verify --short 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 - if tag=`git describe 2>/dev/null`; then - echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' - else - printf '%s%s' -g $head - fi + # Do we have an untagged tag? + if atag=`git describe 2>/dev/null`; then + echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' + # add -g${head}, if there is no usable tag + else + printf '%s%s' -g $head fi # Is this git on svn? |