mirror of
https://github.com/nzbget/nzbget.git
synced 2026-02-24 10:05:52 -05:00
added svn revision number to version string (commands <-v> and <-V>, startup log entry); svn revision is automatically read from svn-repository on each build
This commit is contained in:
21
Util.cpp
21
Util.cpp
@@ -47,6 +47,11 @@
|
||||
#include "nzbget.h"
|
||||
#include "Util.h"
|
||||
|
||||
#ifndef WIN32
|
||||
// function "svn_version" is automatically generated in file "svn_version.cpp" on each build
|
||||
const char* svn_version(void);
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
// getopt for WIN32:
|
||||
@@ -199,6 +204,8 @@ const char* DirBrowser::Next()
|
||||
|
||||
#endif
|
||||
|
||||
char Util::VersionRevisionBuf[40];
|
||||
|
||||
char* Util::BaseFileName(const char* filename)
|
||||
{
|
||||
char* p = (char*)strrchr(filename, PATH_SEPARATOR);
|
||||
@@ -1131,3 +1138,17 @@ void Util::FormatFileSize(char * szBuffer, int iBufLen, long long lFileSize)
|
||||
}
|
||||
szBuffer[iBufLen - 1] = '\0';
|
||||
}
|
||||
|
||||
void Util::InitVersionRevision()
|
||||
{
|
||||
#ifndef WIN32
|
||||
if ((strlen(svn_version()) > 0) && strstr(VERSION, "testing"))
|
||||
{
|
||||
snprintf(VersionRevisionBuf, sizeof(VersionRevisionBuf), "%s-r%s", VERSION, svn_version());
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
snprintf(VersionRevisionBuf, sizeof(VersionRevisionBuf), "%s", VERSION);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user