diff options
-rwxr-xr-x | scripts/setlocalversion | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 453faffe18a7..72d233528ade 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion | |||
@@ -9,11 +9,13 @@ usage() { | |||
9 | cd "${1:-.}" || usage | 9 | cd "${1:-.}" || usage |
10 | 10 | ||
11 | # Check for git and a git repo. | 11 | # Check for git and a git repo. |
12 | if head=`git rev-parse --verify HEAD 2>/dev/null`; then | 12 | if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then |
13 | # Do we have an untagged version? | 13 | # Do we have an untagged version? |
14 | if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then | 14 | if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then |
15 | if tag=`git describe 2>/dev/null`; then | 15 | if tag=`git describe 2>/dev/null`; then |
16 | echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' | 16 | echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' |
17 | else | ||
18 | printf '%s%s' -g $head | ||
17 | fi | 19 | fi |
18 | fi | 20 | fi |
19 | 21 | ||