- try to fix path to /.version file

Conflicts:
	src/gui/imageinfo.cpp
	src/gui/network_setup.cpp
	src/nhttpd/tuxboxapi/controlapi.cpp

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2020-12-06 13:32:20 +01:00
committed by Thilo Graf
parent ea64294d6a
commit cf67ca4cb6
6 changed files with 10 additions and 10 deletions

View File

@@ -29,6 +29,8 @@
#define NEUTRINO_CPP extern #define NEUTRINO_CPP extern
#endif #endif
#define IMAGE_VERSION_FILE "/.version"
#define NEUTRINO_SETTINGS_FILE CONFIGDIR "/neutrino.conf" #define NEUTRINO_SETTINGS_FILE CONFIGDIR "/neutrino.conf"
#define NEUTRINO_SCAN_SETTINGS_FILE CONFIGDIR "/scan.conf" #define NEUTRINO_SCAN_SETTINGS_FILE CONFIGDIR "/scan.conf"
#define NEUTRINO_PARENTALLOCKED_FILE DATADIR "/neutrino/.plocked" #define NEUTRINO_PARENTALLOCKED_FILE DATADIR "/neutrino/.plocked"

View File

@@ -170,7 +170,7 @@ bool CBuildInfo::GetData()
#if 0 #if 0
CConfigFile data ('\t'); CConfigFile data ('\t');
data.loadConfig(TARGET_PREFIX "/.version"); data.loadConfig(IMAGE_VERSION_FILE);
build_info_t creator = {BI_TYPE_ID_CREATOR, LOCALE_BUILDINFO_CREATOR, data.getString("creator", "n/a")}; build_info_t creator = {BI_TYPE_ID_CREATOR, LOCALE_BUILDINFO_CREATOR, data.getString("creator", "n/a")};
v_info.push_back(creator); v_info.push_back(creator);
#endif #endif

View File

@@ -54,8 +54,6 @@
#include <nhttpd/yconfig.h> #include <nhttpd/yconfig.h>
#include <ctype.h> #include <ctype.h>
#define VERSION_FILE "/.version"
#define OS_RELEASE_FILE "/usr/lib/os-release" #define OS_RELEASE_FILE "/usr/lib/os-release"
#define OE_IMAGE_VERSION_FILE "/etc/image-version" #define OE_IMAGE_VERSION_FILE "/etc/image-version"
@@ -305,7 +303,7 @@ void CImageInfo::InitInfoData()
config.clear(); config.clear();
} }
config.loadConfig(VERSION_FILE); config.loadConfig(IMAGE_VERSION_FILE);
string version_string = config.getString("version", ""); string version_string = config.getString("version", "");
@@ -331,7 +329,7 @@ void CImageInfo::InitInfoData()
}else }else
version_string = oe_image_version; version_string = oe_image_version;
}else }else
printf("[CImageInfo]\t[%s - %d], WARNING! %s contains possible wrong version format, content = [%s]\n", __func__, __LINE__, VERSION_FILE, version_string.c_str()); printf("[CImageInfo]\t[%s - %d], WARNING! %s contains possible wrong version format, content = [%s]\n", __func__, __LINE__, IMAGE_VERSION_FILE, version_string.c_str());
#endif #endif
image_info_t imagename = {g_Locale->getText(LOCALE_IMAGEINFO_IMAGE), config.getString("imagename", PACKAGE_NAME)}; image_info_t imagename = {g_Locale->getText(LOCALE_IMAGEINFO_IMAGE), config.getString("imagename", PACKAGE_NAME)};

View File

@@ -710,7 +710,7 @@ void CNetworkSetup::testNetworkSettings()
//get www-domain testsite from /.version //get www-domain testsite from /.version
CConfigFile config('\t'); CConfigFile config('\t');
config.loadConfig("/.version"); config.loadConfig(IMAGE_VERSION_FILE);
testsite = config.getString("homepage",defaultsite); testsite = config.getString("homepage",defaultsite);
testsite.replace( 0, testsite.find("www",0), "" ); testsite.replace( 0, testsite.find("www",0), "" );

View File

@@ -179,7 +179,7 @@ bool CFlashUpdate::checkOnlineVersion()
CConfigFile _configfile('\t'); CConfigFile _configfile('\t');
std::string versionString = "????????????????"; std::string versionString = "????????????????";
if (_configfile.loadConfig(TARGET_PREFIX "/.version")) if (_configfile.loadConfig(IMAGE_VERSION_FILE))
versionString = _configfile.getString("version", "????????????????"); versionString = _configfile.getString("version", "????????????????");
dprintf(DEBUG_NORMAL, "[update] file %s\n", g_settings.softupdate_url_file.c_str()); dprintf(DEBUG_NORMAL, "[update] file %s\n", g_settings.softupdate_url_file.c_str());
CFlashVersionInfo curInfo(versionString.c_str()); CFlashVersionInfo curInfo(versionString.c_str());
@@ -235,7 +235,7 @@ bool CFlashUpdate::selectHttpImage(void)
std::string versionString = "????????????????"; std::string versionString = "????????????????";
std::string imagedescription = ""; std::string imagedescription = "";
std::string imageversion = "n/a"; std::string imageversion = "n/a";
if (_configfile.loadConfig(TARGET_PREFIX "/.version")) if (_configfile.loadConfig(IMAGE_VERSION_FILE))
{ {
versionString = _configfile.getString("version", "????????????????"); versionString = _configfile.getString("version", "????????????????");
imagedescription = _configfile.getString("imagedescription", ""); imagedescription = _configfile.getString("imagedescription", "");

View File

@@ -826,7 +826,7 @@ void CControlAPI::InfoCGI(CyhookHandler *hh)
if (hh->ParamList["1"] == "streaminfo") // print streaminfo if (hh->ParamList["1"] == "streaminfo") // print streaminfo
SendStreamInfo(hh); SendStreamInfo(hh);
else if (hh->ParamList["1"] == "version") // send version file else if (hh->ParamList["1"] == "version") // send version file
hh->SendFile("/.version"); hh->SendFile(IMAGE_VERSION_FILE);
else if (hh->ParamList["1"] == "httpdversion") // print httpd version typ (just for compatibility) else if (hh->ParamList["1"] == "httpdversion") // print httpd version typ (just for compatibility)
hh->Write("3"); hh->Write("3");
else if (hh->ParamList["1"] == "nhttpd_version")// print nhttpd version else if (hh->ParamList["1"] == "nhttpd_version")// print nhttpd version
@@ -2103,7 +2103,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CControlAPI::VersionCGI(CyhookHandler *hh) void CControlAPI::VersionCGI(CyhookHandler *hh)
{ {
hh->SendFile("/.version"); hh->SendFile(IMAGE_VERSION_FILE);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CControlAPI::ReloadNeutrinoSetupCGI(CyhookHandler *hh) void CControlAPI::ReloadNeutrinoSetupCGI(CyhookHandler *hh)