Mercurial > dovecot > core-2.2
annotate update-version.sh @ 22640:cf23a90cd2ca
director: Use t_strsplit_tabescaped_inplace() for director connection input
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Sat, 04 Nov 2017 01:48:41 +0200 |
parents | f4076be3efe9 |
children |
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" |
22046
f4076be3efe9
lib: Add dovecot_build_info variable containing Dovecot build information.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
19542
diff
changeset
|
7 DOVECOT_BUILD_INFO=${DOVECOT_BUILD_INFO:-DOVECOT_VERSION_FULL} |
10999
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
8 |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
9 abspath() |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
10 { #$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
|
11 #$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
|
12 old=`pwd` |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
13 cd "${1}" |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
14 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
|
15 SRCDIR=`pwd` |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
16 else |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
17 BUILDDIR=`pwd` |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
18 fi |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
19 cd "$old" |
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 |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
22 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
|
23 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
|
24 |
19502
f76349851caa
Makefile, update-version.sh: Switched from hg to git.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
14568
diff
changeset
|
25 # 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
|
26 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
|
27 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
|
28 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
|
29 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
|
30 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
|
31 exit 0 |
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 fi |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
35 |
19502
f76349851caa
Makefile, update-version.sh: Switched from hg to git.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
14568
diff
changeset
|
36 # 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
|
37 # 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
|
38 [ ! -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
|
39 |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
40 # 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
|
41 [ -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
|
42 if true; then |
19542
76aa68b2b265
update-version.sh: Explicitly specify git directory.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
19502
diff
changeset
|
43 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
|
44 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
|
45 #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
|
46 #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
|
47 |
19502
f76349851caa
Makefile, update-version.sh: Switched from hg to git.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
14568
diff
changeset
|
48 #define DOVECOT_VERSION_FULL VERSION" (${GITID})" |
22046
f4076be3efe9
lib: Add dovecot_build_info variable containing Dovecot build information.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
19542
diff
changeset
|
49 #define DOVECOT_BUILD_INFO ${DOVECOT_BUILD_INFO} |
10999
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
50 |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
51 #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
|
52 EOF |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
53 else |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
54 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
|
55 #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
|
56 #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
|
57 |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
58 #define DOVECOT_VERSION_FULL VERSION |
22046
f4076be3efe9
lib: Add dovecot_build_info variable containing Dovecot build information.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents:
19542
diff
changeset
|
59 #define DOVECOT_BUILD_INFO ${DOVECOT_BUILD_INFO} |
10999
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
60 |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
61 #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
|
62 EOF |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
63 fi |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
64 |
a2c6c91635b5
{master,doveconf}: Show the version with hg's node id, if unreleased.
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
65 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
|
66 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
|
67 mv -f "${BUILDDIR}/${VERSION_HT}" "${BUILDDIR}/${VERSION_H}" |