Skip to content

Commit 6193c3e

Browse files
committed
build: get version info from git tags instead of configure.ac
1 parent 9ad5f19 commit 6193c3e

File tree

2 files changed

+5
-34
lines changed

2 files changed

+5
-34
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AC_PREREQ(2.64)
2-
AC_INIT([openocd], [0.10.0+dev],
2+
AC_INIT([openocd], [ ],
33
[OpenOCD Mailing List <[email protected]>])
44
AC_CONFIG_SRCDIR([src/openocd.c])
55

guess-rev.sh

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,10 @@ usage() {
1414

1515
cd "${1:-.}" || usage
1616

17-
# Check for git and a git repo.
18-
if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
19-
20-
# If we are at a tagged commit (like "v2.6.30-rc6"), we ignore it,
21-
# because this version is defined in the top level Makefile.
22-
if [ -z "`git describe --exact-match 2>/dev/null`" ]; then
23-
24-
# If we are past a tagged commit (like "v2.6.30-rc5-302-g72357d5"),
25-
# we pretty print it.
26-
if atag="`git describe 2>/dev/null`"; then
27-
echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
28-
29-
# If we don't have a tag at all we print -g{commitish}.
30-
else
31-
printf '%s%s' -g $head
32-
fi
33-
fi
34-
35-
# Is this git on svn?
36-
if git config --get svn-remote.svn.url >/dev/null; then
37-
printf -- '-svn%s' "`git svn find-rev $head`"
38-
fi
39-
40-
# Update index only on r/w media
41-
[ -w . ] && git update-index --refresh --unmerged > /dev/null
42-
43-
# Check for uncommitted changes
44-
if git diff-index --name-only HEAD | grep -v "^scripts/package" \
45-
| read dummy; then
46-
printf '%s' -dirty
47-
fi
48-
49-
# All done with git
17+
# Check for git and a git repo, use 'git describe' output as version.
18+
desc=`git describe --always --tags --dirty --abbrev=8 2>/dev/null`
19+
if [ -n "$desc" ]; then
20+
printf '%s' $desc
5021
exit
5122
fi
5223

0 commit comments

Comments
 (0)