- update: fix release cycle handling; add human readable version string

Signed-off-by: GetAway <get-away@t-online.de>
This commit is contained in:
svenhoefer
2020-06-13 22:18:19 +02:00
committed by GetAway
parent 5d9749b1a0
commit 33ecf51bdb
6 changed files with 27 additions and 22 deletions

View File

@@ -463,23 +463,21 @@ CFlashVersionInfo::CFlashVersionInfo(const std::string & _versionString)
snapshot = versionString[0];
// recover release cycle version
// will be compared with RELEASE_CYCLE, which is defined in configure.ac as "x.0"
releaseCycle[0] = versionString[1];
releaseCycle[1] = '.';
/*
if (versionString[2] == '0')
{
releaseCycle[2] = versionString[3];
releaseCycle[3] = 0;
}
else
*/
{
releaseCycle[2] = versionString[2];
releaseCycle[3] = versionString[3];
releaseCycle[4] = 0;
}
releaseCycle[2] = '0';
releaseCycle[3] = 0;
// human readable version
vstring[0] = versionString[1];
vstring[1] = '.';
vstring[2] = versionString[2];
vstring[3] = versionString[3];
vstring[4] = 0;
version = atoi(&versionString[1])*100 + atoi(&versionString[2])*10 + atoi(&versionString[3]);
version = atoi(&releaseCycle[0]) * 100 + atoi(&releaseCycle[2]);
// recover date
struct tm tt;
memset(&tt, 0, sizeof(tt));
@@ -561,6 +559,11 @@ int CFlashVersionInfo::getVersion(void) const
return version;
}
const char *CFlashVersionInfo::getVersionString(void) const
{
return vstring;
}
//-----------------------------------------------------------------------------------------------------------------
CMTDInfo::CMTDInfo()