@@ -440,6 +440,19 @@ AC_DEFUN([OVS_CHECK_DPDK], [
AM_CONDITIONAL([DPDK_NETDEV], test "$DPDKLIB_FOUND" = true)
])
+dnl Append a version suffix
+
+AC_DEFUN([OVS_CHECK_VERSION_SUFFIX], [
+ AC_ARG_WITH([version-suffix],
+ [AS_HELP_STRING([--with-version-suffix=ver_suffix],
+ [Specify a version suffix that will be appended
+ to OVS version])])
+ AC_DEFINE_UNQUOTED([VERSION_SUFFIX], ["$with_version_suffix"],
+ [Package version suffix])
+ AC_SUBST([VERSION_SUFFIX], [$with_version_suffix])
+ ])
+])
+
dnl Checks for net/if_dl.h.
dnl
dnl (We use this as a proxy for checking whether we're building on FreeBSD
@@ -198,6 +198,7 @@ OVS_CHECK_LINUX_SCTP_CT
OVS_CHECK_LINUX_VIRTIO_TYPES
OVS_CHECK_DPDK
OVS_CHECK_PRAGMA_MESSAGE
+OVS_CHECK_VERSION_SUFFIX
AC_SUBST([CFLAGS])
AC_SUBST([OVS_CFLAGS])
AC_SUBST([OVS_LDFLAGS])
@@ -19,7 +19,7 @@
#define OPENVSWITCH_VERSION_H 1
#define OVS_PACKAGE_STRING "@PACKAGE_STRING@"
-#define OVS_PACKAGE_VERSION "@PACKAGE_VERSION@"
+#define OVS_PACKAGE_VERSION "@PACKAGE_VERSION@@VERSION_SUFFIX@"
#define OVS_LIB_VERSION @LT_CURRENT@
#define OVS_LIB_REVISION @LT_REVISION@
@@ -150,7 +150,7 @@ ovsdb_internal_error(struct ovsdb_error *inner_error,
ds_put_char(&ds, ')');
}
- ds_put_format(&ds, " (%s %s)", program_name, VERSION);
+ ds_put_format(&ds, " (%s %s)", program_name, VERSION VERSION_SUFFIX);
if (inner_error) {
char *s = ovsdb_error_to_string_free(inner_error);
@@ -614,8 +614,9 @@ ovs_set_program_name(const char *argv0, const char *version)
program_name = basename;
free(program_version);
- if (!strcmp(version, VERSION)) {
- program_version = xasprintf("%s (Open vSwitch) "VERSION"\n",
+ if (!strcmp(version, VERSION VERSION_SUFFIX)) {
+ program_version = xasprintf("%s (Open vSwitch) "VERSION
+ VERSION_SUFFIX"\n",
program_name);
} else {
program_version = xasprintf("%s %s\n"
@@ -424,7 +424,8 @@ main(int argc, char *argv[])
/* ovsdb-server is usually a long-running process, in which case it
* makes plenty of sense to log the version, but --run makes
* ovsdb-server more like a command-line tool, so skip it. */
- VLOG_INFO("%s (Open vSwitch) %s", program_name, VERSION);
+ VLOG_INFO("%s (Open vSwitch) %s", program_name,
+ VERSION VERSION_SUFFIX);
}
unixctl_command_register("exit", "", 0, 0, ovsdb_server_exit, &exiting);
@@ -124,7 +124,7 @@ ovs-uninstall-local:
ALL_LOCAL += $(srcdir)/python/ovs/version.py
$(srcdir)/python/ovs/version.py: config.status
$(AM_V_GEN)$(ro_shell) > $(@F).tmp && \
- echo 'VERSION = "$(VERSION)"' >> $(@F).tmp && \
+ echo 'VERSION = "$(VERSION)$(VERSION_SUFFIX)"' >> $(@F).tmp && \
if cmp -s $(@F).tmp $@; then touch $@; rm $(@F).tmp; else mv $(@F).tmp $@; fi
ALL_LOCAL += $(srcdir)/python/ovs/dirs.py
@@ -176,6 +176,7 @@ This package provides IPsec tunneling support for OVS tunnels.
--disable-static \
--enable-shared \
--with-pkidir=%{_sharedstatedir}/openvswitch/pki \
+ --with-version-suffix=-%{release} \
PYTHON3=%{__python3}
build-aux/dpdkstrip.py \
@@ -3321,7 +3321,8 @@ bridge_run(void)
vlog_enable_async();
- VLOG_INFO_ONCE("%s (Open vSwitch) %s", program_name, VERSION);
+ VLOG_INFO_ONCE("%s (Open vSwitch) %s", program_name,
+ VERSION VERSION_SUFFIX);
}
}
Since on CentOS/RHEL the builds are based on stable branches and not on tags for debugging purpose it's better to have the downstream version as version so it's easier to know which commits are included in a build. This commit adds --with-version-suffix as ./configure option in order to set an OVS version suffix that should be shown to the user via ovs-vsctl -V and, so, also on database and on ovs-vsctl show. --with-version-suffix is used in Fedora/CentOS/RHEL spec file in order to have the version be aligned with the downstream one. Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> --- acinclude.m4 | 13 +++++++++++++ configure.ac | 1 + include/openvswitch/version.h.in | 2 +- lib/ovsdb-error.c | 2 +- lib/util.c | 5 +++-- ovsdb/ovsdb-server.c | 3 ++- python/automake.mk | 2 +- rhel/openvswitch-fedora.spec.in | 1 + vswitchd/bridge.c | 3 ++- 9 files changed, 25 insertions(+), 7 deletions(-)