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 | |
parent | c0dd0943168cdcac3efcb0744767eef241a11112 (diff) | |
download | dovecot-antispam-86ef04eac2ce6b9717a56fcc6786aa67057f8774.tar.gz dovecot-antispam-86ef04eac2ce6b9717a56fcc6786aa67057f8774.tar.xz dovecot-antispam-86ef04eac2ce6b9717a56fcc6786aa67057f8774.zip |
make proper version
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | antispam-plugin.c | 2 | ||||
-rwxr-xr-x | git-version.sh | 12 | ||||
-rwxr-xr-x | version.sh | 21 |
4 files changed, 24 insertions, 15 deletions
@@ -77,8 +77,8 @@ dovecot-version: dovecot-version.c $(CONFIG) dovecot-version.h: dovecot-version ./dovecot-version > dovecot-version.h -antispam-version.h: git-version.sh - ./git-version.sh > antispam-version.h +antispam-version.h: version.sh + ./version.sh > antispam-version.h clean: rm -f *.so *.o *~ dovecot-version dovecot-version.h antispam-version.h diff --git a/antispam-plugin.c b/antispam-plugin.c index a7a477b..cebbd97 100644 --- a/antispam-plugin.c +++ b/antispam-plugin.c @@ -136,7 +136,7 @@ void PLUGIN_FUNCTION(init)(void) char * const *iter; int spam_folder_count = 0; - debug("plugin initialising (%s)\n", ANTISPAM_GIT_VERSION); + debug("plugin initialising (%s)\n", ANTISPAM_VERSION); global_pool = pool_alloconly_create("antispam-pool", 1024); diff --git a/git-version.sh b/git-version.sh deleted file mode 100755 index 204ffec..0000000 --- a/git-version.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -if head=`git rev-parse --verify HEAD 2>/dev/null`; then - git update-index --refresh --unmerged > /dev/null - printf "#define ANTISPAM_GIT_VERSION \"git %.8s" "$head" - if git diff-index --name-only HEAD | read dummy ; then - printf ", dirty" - fi - echo '"' -else - echo '#define ANTISPAM_GIT_VERSION "unknown"' -fi 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 |