mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
CImageInfo: fix version string format
String was broken. Only artefacts were to see. BTW: With current yocto build .version contains wrong version format. This seems to be not suitable for handling with flash images in context with versions checks.
This commit is contained in:
@@ -47,6 +47,7 @@
|
|||||||
#include <gui/lua/lua_api_version.h>
|
#include <gui/lua/lua_api_version.h>
|
||||||
#endif
|
#endif
|
||||||
#include <nhttpd/yconfig.h>
|
#include <nhttpd/yconfig.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
#define VERSION_FILE TARGET_PREFIX "/.version"
|
#define VERSION_FILE TARGET_PREFIX "/.version"
|
||||||
|
|
||||||
@@ -276,27 +277,29 @@ void CImageInfo::InitInfoData()
|
|||||||
const char * builddate = config.getString("builddate", "n/a").c_str();
|
const char * builddate = config.getString("builddate", "n/a").c_str();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::string version_string;
|
string version_string = config.getString("version", "");
|
||||||
#ifdef IMAGE_VERSION
|
#ifdef IMAGE_VERSION
|
||||||
version_string = IMAGE_VERSION;
|
version_string = IMAGE_VERSION;
|
||||||
#else
|
#else
|
||||||
std::string _version = config.getString("version", "U000000000000000").c_str();
|
if (isdigit(version_string[0])){
|
||||||
static CFlashVersionInfo versionInfo(_version.c_str());
|
static CFlashVersionInfo versionInfo(version_string.c_str());
|
||||||
|
version_string = versionInfo.getReleaseCycle();
|
||||||
version_string = versionInfo.getReleaseCycle();
|
version_string += " ";
|
||||||
version_string += " ";
|
version_string += versionInfo.getType();
|
||||||
version_string += versionInfo.getType();
|
version_string += " (";
|
||||||
version_string += " (";
|
version_string += versionInfo.getDate();
|
||||||
version_string += versionInfo.getDate();
|
version_string += ")";
|
||||||
version_string += ")";
|
}else
|
||||||
|
printf("[CImageInfo]\t[%s - %d], WARNING! %s contains possible wrong version format, content = [%s]\n", __func__, __LINE__, VERSION_FILE, version_string.c_str());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct utsname uts_info;
|
struct utsname uts_info;
|
||||||
|
|
||||||
image_info_t imagename = {LOCALE_IMAGEINFO_IMAGE, config.getString("imagename", PACKAGE_NAME)};
|
image_info_t imagename = {LOCALE_IMAGEINFO_IMAGE, config.getString("imagename", PACKAGE_NAME)};
|
||||||
v_info.push_back(imagename);
|
v_info.push_back(imagename);
|
||||||
image_info_t version = {LOCALE_IMAGEINFO_VERSION, version_string};
|
if (!version_string.empty()){
|
||||||
v_info.push_back(version);
|
image_info_t version = {LOCALE_IMAGEINFO_VERSION, version_string};
|
||||||
|
v_info.push_back(version);
|
||||||
|
}
|
||||||
#ifdef VCS
|
#ifdef VCS
|
||||||
image_info_t vcs = {LOCALE_IMAGEINFO_VCS, VCS};
|
image_info_t vcs = {LOCALE_IMAGEINFO_VCS, VCS};
|
||||||
v_info.push_back(vcs);
|
v_info.push_back(vcs);
|
||||||
|
Reference in New Issue
Block a user