diff options
Diffstat (limited to 'scripts/setlocalversion')
-rwxr-xr-x | scripts/setlocalversion | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 057b6b3c5dfb..4d403844e137 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion | |||
@@ -86,12 +86,16 @@ scm_version() | |||
86 | 86 | ||
87 | # Check for mercurial and a mercurial repo. | 87 | # Check for mercurial and a mercurial repo. |
88 | if test -d .hg && hgid=`hg id 2>/dev/null`; then | 88 | if test -d .hg && hgid=`hg id 2>/dev/null`; then |
89 | tag=`printf '%s' "$hgid" | cut -s -d' ' -f2` | 89 | # Do we have an tagged version? If so, latesttagdistance == 1 |
90 | 90 | if [ "`hg log -r . --template '{latesttagdistance}'`" == "1" ]; then | |
91 | # Do we have an untagged version? | 91 | id=`hg log -r . --template '{latesttag}'` |
92 | if [ -z "$tag" -o "$tag" = tip ]; then | ||
93 | id=`printf '%s' "$hgid" | sed 's/[+ ].*//'` | ||
94 | printf '%s%s' -hg "$id" | 92 | printf '%s%s' -hg "$id" |
93 | else | ||
94 | tag=`printf '%s' "$hgid" | cut -d' ' -f2` | ||
95 | if [ -z "$tag" -o "$tag" = tip ]; then | ||
96 | id=`printf '%s' "$hgid" | sed 's/[+ ].*//'` | ||
97 | printf '%s%s' -hg "$id" | ||
98 | fi | ||
95 | fi | 99 | fi |
96 | 100 | ||
97 | # Are there uncommitted changes? | 101 | # Are there uncommitted changes? |
@@ -160,8 +164,10 @@ if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then | |||
160 | # full scm version string | 164 | # full scm version string |
161 | res="$res$(scm_version)" | 165 | res="$res$(scm_version)" |
162 | else | 166 | else |
163 | # apped a plus sign if the repository is not in a clean tagged | 167 | # append a plus sign if the repository is not in a clean |
164 | # state and LOCALVERSION= is not specified | 168 | # annotated or signed tagged state (as git describe only |
169 | # looks at signed or annotated tags - git tag -a/-s) and | ||
170 | # LOCALVERSION= is not specified | ||
165 | if test "${LOCALVERSION+set}" != "set"; then | 171 | if test "${LOCALVERSION+set}" != "set"; then |
166 | scm=$(scm_version --short) | 172 | scm=$(scm_version --short) |
167 | res="$res${scm:++}" | 173 | res="$res${scm:++}" |