Skip to content

Commit 509da5c

Browse files
committed
Add tagger.sh
1 parent 2a84d22 commit 509da5c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tagger.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
set -e
3+
set -u
4+
#set -x
5+
6+
# extract AC_INIT package and version
7+
PACKAGE=$(sed -nr "/^AC_INIT\b/{ s/^[^(]*\([ ]*([^, ]+).*/\1/; s/\[|]//g; p; }" configure.ac)
8+
echo PACKAGE="$PACKAGE"
9+
10+
VERSION=$(sed -nr "/^AC_INIT\b/{ s/^[^,]*,[^0-9]*([0-9.]*).*/\1/; p; }" configure.ac)
11+
[[ $VERSION =~ ^[0-9.]+$ ]] || die "failed to detect package version"
12+
echo VERSION="$VERSION"
13+
14+
if git show-ref --tags --quiet --verify -- "refs/tags/$VERSION"
15+
then
16+
echo "tag $VERSION already exists"
17+
exit 1
18+
else
19+
git tag "$VERSION"
20+
fi

0 commit comments

Comments
 (0)