mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 08:21:07 +02:00
update: allow online-update for AX/Mutant; add some beautiful ifdef's
Origin commit data
------------------
Commit: 40fdc818f9
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-10-23 (Mon, 23 Oct 2017)
Origin message was:
------------------
- update: allow online-update for AX/Mutant; add some beautiful ifdef's
This commit is contained in:
@@ -361,6 +361,13 @@ bool CFlashUpdate::selectHttpImage(void)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if HAVE_ARM_HARDWARE
|
||||
if ((fileType <= '2') && (filename.substr(filename.find_last_of(".") + 1) == "tgz"))
|
||||
{
|
||||
// manipulate fileType for tgz-packages
|
||||
fileType = 'Z';
|
||||
}
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
printf("[update] filename %s type %c newVersion %s md5 %s\n", filename.c_str(), fileType, newVersion.c_str(), file_md5.c_str());
|
||||
#endif
|
||||
@@ -452,10 +459,14 @@ bool CFlashUpdate::checkVersion4Update()
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string filters[] = {"bin", "txt", "opk", "ipk", "tgz"};
|
||||
std::string filters[] = {"bin", "txt", "opk", "ipk"};
|
||||
for(size_t i=0; i<sizeof(filters)/sizeof(filters[0]) ;i++)
|
||||
UpdatesFilter.addFilter(filters[i]);
|
||||
|
||||
#if HAVE_ARM_HARDWARE
|
||||
UpdatesFilter.addFilter("tgz");
|
||||
#endif
|
||||
|
||||
UpdatesBrowser.Filter = &UpdatesFilter;
|
||||
|
||||
CFile * file_selected = NULL;
|
||||
@@ -497,13 +508,14 @@ bool CFlashUpdate::checkVersion4Update()
|
||||
//!always leave here!
|
||||
return false;
|
||||
}
|
||||
#if HAVE_ARM_HARDWARE
|
||||
//tgz package install:
|
||||
else if (file_selected->getType() == CFile::FILE_TGZ_PACKAGE){
|
||||
fileType = 'Z';
|
||||
printf("[update] auto file type: %d (%d) %c\n", file_selected->getType(), CFile::FILE_TGZ_PACKAGE, fileType);
|
||||
//!always leave here!
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
//set internal filetype
|
||||
char const * ptr = rindex(filename.c_str(), '.');
|
||||
if(ptr) {
|
||||
@@ -645,6 +657,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
free(buffer);
|
||||
}
|
||||
}
|
||||
#if HAVE_ARM_HARDWARE
|
||||
else if (fileType == 'Z')
|
||||
{
|
||||
showGlobalStatus(100);
|
||||
@@ -657,6 +670,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
my_system(3, ofgwrite_tgz, g_settings.update_dir.c_str(), filename.c_str());
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
else // not image, install
|
||||
{
|
||||
const char install_sh[] = "/bin/install.sh";
|
||||
|
Reference in New Issue
Block a user