This removes the single 'git revision' line from the --version screen and
moves this information on the top, together with the OpenVPN version.
In addition this patch adds two git flags after the git committish. If
there exists changed but unstaged files when the build was done, a '+' is
appended after the committish. If there exists staged files (files which
have been added with 'git add') a '*' will be appended. These flags are
not exclusive.
This also simplifies the config-version.h generation by not using
sed parsing a template. It's just two lines which are generated, so
no need to complicate things more than needed.
Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1366375212-14886-1-git-send-email-dazo@users.sourceforge.net
URL: http://article.gmane.org/gmane.network.openvpn.devel/7522
... | ... |
@@ -66,7 +66,6 @@ dist_doc_DATA = \ |
66 | 66 |
dist_noinst_DATA = \ |
67 | 67 |
.gitignore \ |
68 | 68 |
.gitattributes \ |
69 |
- config-version.h.in \ |
|
70 | 69 |
PORTS \ |
71 | 70 |
README.IPv6 TODO.IPv6 \ |
72 | 71 |
README.polarssl \ |
... | ... |
@@ -91,8 +90,12 @@ root_DATA = version.sh |
91 | 91 |
endif |
92 | 92 |
|
93 | 93 |
config-version.h: |
94 |
- @CONFIGURE_GIT_REVISION="`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) rev-parse --symbolic-full-name HEAD`/`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) rev-parse --short=16 HEAD`"; \ |
|
95 |
- $(SED) "s#@CONFIGURE_GIT_REVISION[@]#$${CONFIGURE_GIT_REVISION}#g" "$(srcdir)/config-version.h.in" > config-version.h.tmp |
|
94 |
+ @CONFIGURE_GIT_CHFILES="`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) diff-files --name-status -r --ignore-submodules --quiet -- || echo \"+\"`"; \ |
|
95 |
+ CONFIGURE_GIT_UNCOMMITTED="`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) diff-index --cached --quiet --ignore-submodules HEAD || echo \"*\"`"; \ |
|
96 |
+ CONFIGURE_GIT_REVISION="`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) rev-parse --symbolic-full-name HEAD | cut -d/ -f3-`/`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) rev-parse --short=16 HEAD`"; \ |
|
97 |
+ echo "#define CONFIGURE_GIT_REVISION \"$${CONFIGURE_GIT_REVISION}\"" > config-version.h.tmp; \ |
|
98 |
+ echo "#define CONFIGURE_GIT_FLAGS \"$${CONFIGURE_GIT_CHFILES}$${CONFIGURE_GIT_UNCOMMITTED}\"" >> config-version.h.tmp |
|
99 |
+ |
|
96 | 100 |
@if ! [ -f config-version.h ] || ! cmp -s config-version.h.tmp config-version.h; then \ |
97 | 101 |
echo "replacing config-version.h"; \ |
98 | 102 |
mv config-version.h.tmp config-version.h; \ |
... | ... |
@@ -64,6 +64,9 @@ |
64 | 64 |
|
65 | 65 |
const char title_string[] = |
66 | 66 |
PACKAGE_STRING |
67 |
+#ifdef CONFIGURE_GIT_REVISION |
|
68 |
+ " [git:" CONFIGURE_GIT_REVISION CONFIGURE_GIT_FLAGS "]" |
|
69 |
+#endif |
|
67 | 70 |
" " TARGET_ALIAS |
68 | 71 |
#ifdef ENABLE_CRYPTO |
69 | 72 |
#ifdef ENABLE_SSL |
... | ... |
@@ -3426,9 +3429,6 @@ usage_version (void) |
3426 | 3426 |
#ifdef CONFIGURE_SPECIAL_BUILD |
3427 | 3427 |
msg (M_INFO|M_NOPREFIX, "special build: %s", CONFIGURE_SPECIAL_BUILD); |
3428 | 3428 |
#endif |
3429 |
-#ifdef CONFIGURE_GIT_REVISION |
|
3430 |
- msg (M_INFO|M_NOPREFIX, "git revision: %s", CONFIGURE_GIT_REVISION); |
|
3431 |
-#endif |
|
3432 | 3429 |
#endif |
3433 | 3430 |
openvpn_exit (OPENVPN_EXIT_STATUS_USAGE); /* exit point */ |
3434 | 3431 |
} |
... | ... |
@@ -1,7 +1,7 @@ |
1 | 1 |
dnl define the OpenVPN version |
2 | 2 |
define([PRODUCT_NAME], [OpenVPN]) |
3 | 3 |
define([PRODUCT_TARNAME], [openvpn]) |
4 |
-define([PRODUCT_VERSION], [2.3_master]) |
|
4 |
+define([PRODUCT_VERSION], [2.3_git]) |
|
5 | 5 |
define([PRODUCT_BUGREPORT], [openvpn-users@lists.sourceforge.net]) |
6 | 6 |
define([PRODUCT_VERSION_RESOURCE], [2,3,0,0]) |
7 | 7 |
dnl define the TAP version |