~ubuntu-branches/ubuntu/trusty/dovecot-antispam/trusty-proposed

« back to all changes in this revision

Viewing changes to version.sh

  • Committer: Bazaar Package Importer
  • Author(s): Jonny Lamb
  • Date: 2009-03-04 16:06:42 UTC
  • Revision ID: james.westby@ubuntu.com-20090304160642-z0h8pw2urk6geh9j
Tags: upstream-1.1+20090218.git.g28075fa
ImportĀ upstreamĀ versionĀ 1.1+20090218.git.g28075fa

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
VERSION=1.1
 
4
 
 
5
if head=$(git rev-parse --verify HEAD 2>/dev/null); then
 
6
        git update-index --refresh --unmerged > /dev/null
 
7
        descr=$(git describe)
 
8
        
 
9
        # on git builds check that the version number above
 
10
        # is correct...
 
11
        [ "${descr%%-*}" = "v$VERSION" ] || exit 2
 
12
 
 
13
        echo -n '#define ANTISPAM_VERSION "'
 
14
        echo -n "${descr#v}"
 
15
        if git diff-index --name-only HEAD | read dummy ; then
 
16
                echo -n "-dirty"
 
17
        fi
 
18
        echo '"'
 
19
else
 
20
        echo '#define ANTISPAM_VERSION "'$VERSION'-notgit"'
 
21
fi