2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

python: Make build number format consistent with C.

The C code displays the build number as the empty string when 0,
and as +build<num> otherwise.  This commit updates version.py to be
consistent and tests that it is in the unit tests.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
This commit is contained in:
Ethan Jackson
2012-03-07 15:48:32 -08:00
parent 7921b912de
commit c9a2d670eb
4 changed files with 8 additions and 7 deletions

View File

@@ -64,5 +64,8 @@ ALL_LOCAL += $(srcdir)/python/ovs/version.py
$(srcdir)/python/ovs/version.py: config.status
$(ro_shell) > $@.tmp
echo 'VERSION = "$(VERSION)"' >> $@.tmp
echo 'BUILDNR = "$(BUILDNR)"' >> $@.tmp
if [ "$(BUILDNR)" != "0" ]; \
then echo 'BUILDNR = "+build$(BUILDNR)"' >> $@.tmp; \
else echo 'BUILDNR = ""' >> $@.tmp; \
fi;
mv $@.tmp $@

View File

@@ -57,9 +57,9 @@ def _unixctl_help(conn, unused_argv, unused_aux):
def _unixctl_version(conn, unused_argv, unused_aux):
assert isinstance(conn, UnixctlConnection)
version = "%s (Open vSwitch) %s %s" % (ovs.util.PROGRAM_NAME,
ovs.version.VERSION,
ovs.version.BUILDNR)
version = "%s (Open vSwitch) %s%s" % (ovs.util.PROGRAM_NAME,
ovs.version.VERSION,
ovs.version.BUILDNR)
conn.reply(version)