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
+5 -5
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;
xdate_t=(time_t)atoi(xdate);
if (!(xdate_tm=gmtime(&xdate_t))) return 1;
strftime(xfdate,sizeof(xfdate),"%a, %d %b %Y %H:%M:%S Z",xdate_tm);
if ((sys1(xcommit,sizeof(xcommit),"git rev-list -n1 --abbrev=10 --abbrev-commit HEAD")))
strftime(xfdate,sizeof(xfdate),"%Y-%m-%d %H:%M:%SZ",xdate_tm);
if ((sys1(xcommit,sizeof(xcommit),"git rev-list -n1 --abbrev=7 --abbrev-commit HEAD")))
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"))) {
char buf[256], now[256]; time_t now_t=time(NULL); struct tm *now_tm;
if (!(now_tm=gmtime(&now_t))) return 1;
strftime(now,sizeof(now),"%a, %d %b %Y %H:%M:%S Z",now_tm);
snprintf(buf,sizeof(buf),"%s; unclean git build on %s",xver,now);
strftime(now,sizeof(now),"%Y-%m-%d %H:%M:%SZ",now_tm);
snprintf(buf,sizeof(buf),"%s unclean %s",xver,now);
strncpy(xver,buf,sizeof(xver));
}
printf("%s\n",xver);