Make version output more human-friendly

Our main version string is designed for release engineering purposes:
it matches file name conventions used for versioned tarballs and the
versions sort lexicographically while containing all pertinent
information.

With this commit we add in parentheses a more human-friendly rendering
of the version string: we spell out the meaning of each field and
render the datetime in RFC 822 notation.
This commit is contained in:
Travis Cross
2012-07-20 07:33:40 +00:00
parent cae357e784
commit a8019d803c
10 changed files with 48 additions and 6 deletions
+2
View File
@@ -41,7 +41,9 @@ extern "C" {
#define SWITCH_VERSION_MINOR "@freeswitch_MINOR_VERSION@"
#define SWITCH_VERSION_MICRO "@freeswitch_PATCH_LEVEL@"
#define SWITCH_VERSION_REVISION "@Project_WC_REVISION@"
#define SWITCH_VERSION_REVISION_HUMAN "@Project_WC_REVISION@"
#define SWITCH_VERSION_FULL SWITCH_VERSION_MAJOR "." SWITCH_VERSION_MINOR "." SWITCH_VERSION_MICRO SWITCH_VERSION_REVISION
#define SWITCH_VERSION_FULL_HUMAN SWITCH_VERSION_MAJOR "." SWITCH_VERSION_MINOR "." SWITCH_VERSION_MICRO SWITCH_VERSION_REVISION_HUMAN
#ifdef __cplusplus
}
+2
View File
@@ -41,7 +41,9 @@ extern "C" {
#define SWITCH_VERSION_MINOR "@SWITCH_VERSION_MINOR@"
#define SWITCH_VERSION_MICRO "@SWITCH_VERSION_MICRO@"
#define SWITCH_VERSION_REVISION "@SWITCH_VERSION_REVISION@"
#define SWITCH_VERSION_REVISION_HUMAN "@SWITCH_VERSION_REVISION_HUMAN@"
#define SWITCH_VERSION_FULL SWITCH_VERSION_MAJOR "." SWITCH_VERSION_MINOR "." SWITCH_VERSION_MICRO SWITCH_VERSION_REVISION
#define SWITCH_VERSION_FULL_HUMAN SWITCH_VERSION_MAJOR "." SWITCH_VERSION_MINOR "." SWITCH_VERSION_MICRO SWITCH_VERSION_REVISION_HUMAN
#ifdef __cplusplus
}
@@ -285,7 +285,7 @@ SWITCH_STANDARD_API(shutdown_function)
SWITCH_STANDARD_API(version_function)
{
stream->write_function(stream, "FreeSWITCH Version %s\n", SWITCH_VERSION_FULL);
stream->write_function(stream, "FreeSWITCH Version %s (%s)\n", SWITCH_VERSION_FULL, SWITCH_VERSION_FULL_HUMAN);
return SWITCH_STATUS_SUCCESS;
}
+1 -1
View File
@@ -577,7 +577,7 @@ int main(int argc, char *argv[])
}
else if (!strcmp(local_argv[x], "-version")) {
fprintf(stdout, "FreeSWITCH version: %s\n", SWITCH_VERSION_FULL);
fprintf(stdout, "FreeSWITCH version: %s (%s)\n", SWITCH_VERSION_FULL, SWITCH_VERSION_FULL_HUMAN);
exit(EXIT_SUCCESS);
}
#endif
+2 -1
View File
@@ -1959,7 +1959,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE,
"\nFreeSWITCH Version %s Started.\nMax Sessions[%u]\nSession Rate[%d]\nSQL [%s]\n", SWITCH_VERSION_FULL,
"\nFreeSWITCH Version %s (%s) Started.\nMax Sessions[%u]\nSession Rate[%d]\nSQL [%s]\n",
SWITCH_VERSION_FULL, SWITCH_VERSION_FULL_HUMAN,
switch_core_session_limit(0),
switch_core_sessions_per_second(0), switch_test_flag((&runtime), SCF_USE_SQL) ? "Enabled" : "Disabled");