diff options
Diffstat (limited to 'scripts/setlocalversion')
-rwxr-xr-x | scripts/setlocalversion | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 83b75126c9f7..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 | ||
@@ -55,7 +57,7 @@ if rev=`svn info 2>/dev/null | grep '^Revision'`; then | |||
55 | 57 | ||
56 | # Are there uncommitted changes? | 58 | # Are there uncommitted changes? |
57 | if [ $changes != 0 ]; then | 59 | if [ $changes != 0 ]; then |
58 | printf -- '-svn%s%s%s' "$rev" -dirty "$changes" | 60 | printf -- '-svn%s%s' "$rev" -dirty |
59 | else | 61 | else |
60 | printf -- '-svn%s' "$rev" | 62 | printf -- '-svn%s' "$rev" |
61 | fi | 63 | fi |