]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: version: report the version status in "haproxy -v"
authorWilly Tarreau <w@1wt.eu>
Thu, 21 Nov 2019 17:07:30 +0000 (18:07 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 21 Nov 2019 17:47:54 +0000 (18:47 +0100)
As discussed on Discourse here:

    https://discourse.haproxy.org/t/haproxy-branch-support-lifetime/4466

it's not always easy for end users to know the lifecycle of the version
they are using. This patch introduces a "Status" line in the output of
"haproxy -vv" indicating whether it's a development, stable, long-term
supported version, possibly with an estimated end of life for the branch
when it can be anticipated (e.g. for stable versions). This field should
be adjusted when creating a major release to reflect the new status.

It may make sense to backport this to other branches to clarify the
situation.

include/common/version.h
src/haproxy.c

index 248c22e23872e18d9bec567e8d35a9f30083ce85..fd5c954401a23d8d03618949b61351288a3de173 100644 (file)
 #define PRODUCT_BRANCH   "2.1"
 #endif
 
+#ifdef  CONFIG_PRODUCT_STATUS
+#define PRODUCT_STATUS    CONFIG_PRODUCT_STATUS
+#else
+#define PRODUCT_STATUS   "Status: development branch - not safe for use in production."
+#endif
+
 #ifdef  CONFIG_PRODUCT_URL
 #define PRODUCT_URL    CONFIG_PRODUCT_URL
 #else
index 699a1fea0e3f56f4b275e53a433a5853c192cc9b..32d9d33cecb52e1a6adf13eb728269f45576588a 100644 (file)
@@ -543,7 +543,8 @@ void hap_register_per_thread_free(int (*fct)())
 
 static void display_version()
 {
-       printf("HA-Proxy version %s %s - https://haproxy.org/\n", haproxy_version, haproxy_date);
+       printf("HA-Proxy version %s %s - https://haproxy.org/\n"
+              PRODUCT_STATUS "\n", haproxy_version, haproxy_date);
 }
 
 static void display_build_opts()