diff options
author | Yaniv Kamay <ykamay@redhat.com> | 2010-01-10 20:14:52 +0200 |
---|---|---|
committer | Yaniv Kamay <ykamay@redhat.com> | 2010-01-10 20:16:32 +0200 |
commit | 54535ba04e65e7815f572b7335713089907c7656 (patch) | |
tree | d7055e0369aca80ae50cf5370f36bfac624297b0 | |
parent | 884beed580aab5a3609473e9c9291e7f4c8d2e7c (diff) | |
download | spice-54535ba04e65e7815f572b7335713089907c7656.tar.gz spice-54535ba04e65e7815f572b7335713089907c7656.tar.xz spice-54535ba04e65e7815f572b7335713089907c7656.zip |
add patch id and distro name to version string
-rw-r--r-- | client/x11/main.cpp | 20 | ||||
-rw-r--r-- | server/reds.c | 8 |
2 files changed, 24 insertions, 4 deletions
diff --git a/client/x11/main.cpp b/client/x11/main.cpp index de920f9b..63b1134c 100644 --- a/client/x11/main.cpp +++ b/client/x11/main.cpp @@ -24,7 +24,22 @@ static void cleanup() log4cpp::Category::shutdown(); } -const char * version_str = VERSION; +static std::string full_version_str; + +static void init_version_str() +{ + full_version_str += VERSION; + + if (strlen(PATCHID)) { + full_version_str += "-"; + full_version_str += PATCHID; + } + + if (strlen(DISTRIBUTION)) { + full_version_str += "."; + full_version_str += DISTRIBUTION; + } +} int main(int argc, char** argv) { @@ -32,7 +47,8 @@ int main(int argc, char** argv) atexit(cleanup); try { - exit_val = Application::main(argc, argv, version_str); + init_version_str(); + exit_val = Application::main(argc, argv, full_version_str.c_str()); LOG_INFO("Spice client terminated (exitcode = %d)", exit_val); } catch (Exception& e) { LOG_ERROR("unhandle exception: %s", e.what()); diff --git a/server/reds.c b/server/reds.c index d1f3ba17..f5de3eee 100644 --- a/server/reds.c +++ b/server/reds.c @@ -5371,13 +5371,17 @@ static void init_vd_agent_resources() state->plug.wakeup = reds_agent_wakeup; } -const char *version_string = VERSION; +static const char *version_string = VERSION; +static const char *patch_string = PATCHID; +static const char *distro_string = DISTRIBUTION; void __attribute__ ((visibility ("default"))) spice_init(CoreInterface *core_interface) { VDInterface *interface = NULL; - red_printf("starting %s", version_string); + red_printf("starting %s%s%s%s%s", version_string, + strlen(patch_string) ? "-" : "", patch_string, + strlen(distro_string) ? "." : "", distro_string); if (core_interface->base.base_version != VM_INTERFACE_VERSION) { red_error("bad base interface version"); |