Condense the humanized FS version string

Old:
FreeSWITCH Version 1.3.0+git~20120916T192130Z~3b5aa066c7 (1.3.0; git at commit 3b5aa066c7 on Sun, 16 Sep 2012 19:21:30 Z)

New:
FreeSWITCH Version 1.3.0+git~20120916T192130Z~3b5aa066c7 (git 3b5aa06 2012-09-16 19:21:30Z)
This commit is contained in:
Travis Cross 2012-09-21 18:04:41 +00:00
parent 3439d1b3b4
commit 72baa97369
6 changed files with 10 additions and 10 deletions

View File

@ -69,15 +69,15 @@ static int print_human_version(void) {
if ((sys1(xdate,sizeof(xdate),"git log -n1 --format='%ct' HEAD"))) return 1; if ((sys1(xdate,sizeof(xdate),"git log -n1 --format='%ct' HEAD"))) return 1;
xdate_t=(time_t)atoi(xdate); xdate_t=(time_t)atoi(xdate);
if (!(xdate_tm=gmtime(&xdate_t))) return 1; if (!(xdate_tm=gmtime(&xdate_t))) return 1;
strftime(xfdate,sizeof(xfdate),"%a, %d %b %Y %H:%M:%S Z",xdate_tm); strftime(xfdate,sizeof(xfdate),"%Y-%m-%d %H:%M:%SZ",xdate_tm);
if ((sys1(xcommit,sizeof(xcommit),"git rev-list -n1 --abbrev=10 --abbrev-commit HEAD"))) if ((sys1(xcommit,sizeof(xcommit),"git rev-list -n1 --abbrev=7 --abbrev-commit HEAD")))
return 1; return 1;
snprintf(xver,sizeof(xver),"; git at commit %s on %s",xcommit,xfdate); snprintf(xver,sizeof(xver),"git %s %s",xcommit,xfdate);
if (show_unclean && (sys(NULL,0,"git diff-index --quiet HEAD"))) { if (show_unclean && (sys(NULL,0,"git diff-index --quiet HEAD"))) {
char buf[256], now[256]; time_t now_t=time(NULL); struct tm *now_tm; char buf[256], now[256]; time_t now_t=time(NULL); struct tm *now_tm;
if (!(now_tm=gmtime(&now_t))) return 1; if (!(now_tm=gmtime(&now_t))) return 1;
strftime(now,sizeof(now),"%a, %d %b %Y %H:%M:%S Z",now_tm); strftime(now,sizeof(now),"%Y-%m-%d %H:%M:%SZ",now_tm);
snprintf(buf,sizeof(buf),"%s; unclean git build on %s",xver,now); snprintf(buf,sizeof(buf),"%s unclean %s",xver,now);
strncpy(xver,buf,sizeof(xver)); strncpy(xver,buf,sizeof(xver));
} }
printf("%s\n",xver); printf("%s\n",xver);

View File

@ -43,7 +43,7 @@ extern "C" {
#define SWITCH_VERSION_REVISION "@Project_WC_REVISION@" #define SWITCH_VERSION_REVISION "@Project_WC_REVISION@"
#define SWITCH_VERSION_REVISION_HUMAN "@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 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 #define SWITCH_VERSION_FULL_HUMAN SWITCH_VERSION_MAJOR "." SWITCH_VERSION_MINOR "." SWITCH_VERSION_MICRO " " SWITCH_VERSION_REVISION_HUMAN
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -43,7 +43,7 @@ extern "C" {
#define SWITCH_VERSION_REVISION "@SWITCH_VERSION_REVISION@" #define SWITCH_VERSION_REVISION "@SWITCH_VERSION_REVISION@"
#define SWITCH_VERSION_REVISION_HUMAN "@SWITCH_VERSION_REVISION_HUMAN@" #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 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 #define SWITCH_VERSION_FULL_HUMAN SWITCH_VERSION_MAJOR "." SWITCH_VERSION_MINOR "." SWITCH_VERSION_MICRO " " SWITCH_VERSION_REVISION_HUMAN
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -286,7 +286,7 @@ SWITCH_STANDARD_API(shutdown_function)
SWITCH_STANDARD_API(version_function) SWITCH_STANDARD_API(version_function)
{ {
stream->write_function(stream, "FreeSWITCH Version %s (%s)\n", SWITCH_VERSION_FULL, SWITCH_VERSION_FULL_HUMAN); stream->write_function(stream, "FreeSWITCH Version %s (%s)\n", SWITCH_VERSION_FULL, SWITCH_VERSION_REVISION_HUMAN);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }

View File

@ -577,7 +577,7 @@ int main(int argc, char *argv[])
} }
else if (!strcmp(local_argv[x], "-version")) { else if (!strcmp(local_argv[x], "-version")) {
fprintf(stdout, "FreeSWITCH version: %s (%s)\n", SWITCH_VERSION_FULL, SWITCH_VERSION_FULL_HUMAN); fprintf(stdout, "FreeSWITCH version: %s (%s)\n", SWITCH_VERSION_FULL, SWITCH_VERSION_REVISION_HUMAN);
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
#endif #endif

View File

@ -2013,7 +2013,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE,
"\nFreeSWITCH Version %s (%s) Started.\nMax Sessions[%u]\nSession Rate[%d]\nSQL [%s]\n", "\nFreeSWITCH Version %s (%s) Started.\nMax Sessions[%u]\nSession Rate[%d]\nSQL [%s]\n",
SWITCH_VERSION_FULL, SWITCH_VERSION_FULL_HUMAN, SWITCH_VERSION_FULL, SWITCH_VERSION_REVISION_HUMAN,
switch_core_session_limit(0), switch_core_session_limit(0),
switch_core_sessions_per_second(0), switch_test_flag((&runtime), SCF_USE_SQL) ? "Enabled" : "Disabled"); switch_core_sessions_per_second(0), switch_test_flag((&runtime), SCF_USE_SQL) ? "Enabled" : "Disabled");