X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=scripts%2Fsetlocalversion;h=32c8554f3946dee390b56eda335facd94f0764fa;hb=b4324b5dc5b62ba76372e1bf8927230cf744df66;hp=47e75b69a2e974b77e22da05d2a2a3b31655f1a8;hpb=3c1795cc4bd9d57281bebc314315b8afa217b9c7;p=karo-tx-linux.git 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?