Mercurial > dovecot > core-2.2
annotate update-version.sh @ 19584:5795761cec2b
lib-mail: Added message_header_line_write()
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Mon, 18 Jan 2016 14:56:24 +0200 |
parents | 76aa68b2b265 |
children | f4076be3efe9 |
rev | line source |
---|---|
10999
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
1 #!/bin/sh |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
2 |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
3 SRCDIR="${1:-`pwd`}" |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
4 BUILDDIR="${2:-`pwd`}" |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
5 VERSION_H="dovecot-version.h" |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
6 VERSION_HT="dovecot-version.h.tmp" |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
7 |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
8 abspath() |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
9 { #$1 the path |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
10 #$2 1 -> SRCDIR || 2 -> BUILDDIR |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
11 old=`pwd` |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
12 cd "${1}" |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
13 if [ ${2} -eq 1 ]; then |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
14 SRCDIR=`pwd` |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
15 else |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
16 BUILDDIR=`pwd` |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
17 fi |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
18 cd "$old" |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
19 } |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
20 |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
21 abspath "${SRCDIR}" 1 |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
22 abspath "${BUILDDIR}" 2 |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
23 |
19502
f76349851caa
Makefile, update-version.sh: Switched from hg to git.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
14568
diff
changeset
|
24 # when using a different BUILDDIR just copy from SRCDIR, if there is no .git |
10999
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
25 if [ "${BUILDDIR}" != "${SRCDIR}" ]; then |
19502
f76349851caa
Makefile, update-version.sh: Switched from hg to git.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
14568
diff
changeset
|
26 if [ ! -d "${SRCDIR}/.git" ] && [ -f "${SRCDIR}/${VERSION_H}" ]; then |
10999
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
27 cmp -s "${SRCDIR}/${VERSION_H}" "${BUILDDIR}/${VERSION_H}" |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
28 if [ $? -ne 0 ]; then |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
29 cp "${SRCDIR}/${VERSION_H}" "${BUILDDIR}/${VERSION_H}" |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
30 exit 0 |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
31 fi |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
32 fi |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
33 fi |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
34 |
19502
f76349851caa
Makefile, update-version.sh: Switched from hg to git.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
14568
diff
changeset
|
35 # Don't generate dovecot-version.h if the source tree has no .git dir but |
10999
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
36 # a dovecot-version.h. This may be the result of a release/nightly tarball. |
19502
f76349851caa
Makefile, update-version.sh: Switched from hg to git.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
14568
diff
changeset
|
37 [ ! -d "${SRCDIR}/.git" ] && [ -f "${BUILDDIR}/${VERSION_H}" ] && exit 0 |
10999
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
38 |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
39 # Lets generate the dovecot-version.h |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
40 [ -f "${BUILDDIR}/${VERSION_HT}" ] && rm -f "${BUILDDIR}/${VERSION_HT}" |
19502
f76349851caa
Makefile, update-version.sh: Switched from hg to git.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
14568
diff
changeset
|
41 if true; then |
19542
76aa68b2b265
update-version.sh: Explicitly specify git directory.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
19502
diff
changeset
|
42 GITID=`git --git-dir ${SRCDIR}/.git rev-parse --short HEAD` |
10999
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
43 cat > "${BUILDDIR}/${VERSION_HT}" <<EOF |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
44 #ifndef DOVECOT_VERSION_H |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
45 #define DOVECOT_VERSION_H |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
46 |
19502
f76349851caa
Makefile, update-version.sh: Switched from hg to git.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
14568
diff
changeset
|
47 #define DOVECOT_VERSION_FULL VERSION" (${GITID})" |
10999
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
48 |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
49 #endif /* DOVECOT_VERSION_H */ |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
50 EOF |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
51 else |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
52 cat > "${BUILDDIR}/${VERSION_HT}" <<EOF |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
53 #ifndef DOVECOT_VERSION_H |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
54 #define DOVECOT_VERSION_H |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
55 |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
56 #define DOVECOT_VERSION_FULL VERSION |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
57 |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
58 #endif /* DOVECOT_VERSION_H */ |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
59 EOF |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
60 fi |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
61 |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
62 cmp -s "${BUILDDIR}/${VERSION_H}" "${BUILDDIR}/${VERSION_HT}" && \ |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
63 rm -f "${BUILDDIR}/${VERSION_HT}" || \ |
14568
bb572accd1af
update-version.sh: Use mv -f to avoid questions in some systems.
Timo Sirainen <tss@iki.fi>
parents:
10999
diff
changeset
|
64 mv -f "${BUILDDIR}/${VERSION_HT}" "${BUILDDIR}/${VERSION_H}" |