diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-09-18 12:47:12 +0200 |
---|---|---|
committer | Johannes Berg <johannes@sipsolutions.net> | 2008-09-18 12:47:12 +0200 |
commit | 86ef04eac2ce6b9717a56fcc6786aa67057f8774 (patch) | |
tree | 298985f2096f45fc83556bcaa04184489a6333b2 /version.sh | |
parent | c0dd0943168cdcac3efcb0744767eef241a11112 (diff) | |
download | dovecot-antispam-86ef04eac2ce6b9717a56fcc6786aa67057f8774.tar.gz dovecot-antispam-86ef04eac2ce6b9717a56fcc6786aa67057f8774.tar.xz dovecot-antispam-86ef04eac2ce6b9717a56fcc6786aa67057f8774.zip |
make proper version
Diffstat (limited to 'version.sh')
-rwxr-xr-x | version.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/version.sh b/version.sh new file mode 100755 index 0000000..59341a5 --- /dev/null +++ b/version.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +VERSION=1.0 + +if head=$(git rev-parse --verify HEAD 2>/dev/null); then + git update-index --refresh --unmerged > /dev/null + descr=$(git describe) + + # on git builds check that the version number above + # is correct... + [ "${descr%%-*}" = "v$VERSION" ] || exit 2 + + echo -n '#define ANTISPAM_VERSION "' + echo -n "${descr#v}" + if git diff-index --name-only HEAD | read dummy ; then + echo -n "-dirty" + fi + echo '"' +else + echo '#define ANTISPAM_VERSION "'$VERSION'-notgit"' +fi |