mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-04 19:31:56 +00:00
Condense the humanized FS version string
Old: FreeSWITCH Version 1.3.0+git~20120916T192130Z~3b5aa066c7 (1.3.0; git at commit3b5aa066c7on Sun, 16 Sep 2012 19:21:30 Z) New: FreeSWITCH Version 1.3.0+git~20120916T192130Z~3b5aa066c7 (git3b5aa062012-09-16 19:21:30Z)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user