mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
- update: allow tgz-tarballs for update via ofgwrite
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -78,6 +78,7 @@ static const file_ext_s file_ext[] =
|
|||||||
{ "pls", CFile::FILE_PLAYLIST },
|
{ "pls", CFile::FILE_PLAYLIST },
|
||||||
{ "png", CFile::FILE_PICTURE },
|
{ "png", CFile::FILE_PICTURE },
|
||||||
{ "sh", CFile::FILE_TEXT },
|
{ "sh", CFile::FILE_TEXT },
|
||||||
|
{ "tgz", CFile::FILE_TGZ_PACKAGE },
|
||||||
{ "ts", CFile::FILE_TS },
|
{ "ts", CFile::FILE_TS },
|
||||||
{ "txt", CFile::FILE_TEXT },
|
{ "txt", CFile::FILE_TEXT },
|
||||||
{ "url", CFile::STREAM_AUDIO },
|
{ "url", CFile::STREAM_AUDIO },
|
||||||
|
@@ -73,6 +73,7 @@ class CFile
|
|||||||
FILE_PKG_PACKAGE,
|
FILE_PKG_PACKAGE,
|
||||||
FILE_PLAYLIST,
|
FILE_PLAYLIST,
|
||||||
FILE_TEXT,
|
FILE_TEXT,
|
||||||
|
FILE_TGZ_PACKAGE,
|
||||||
FILE_TS,
|
FILE_TS,
|
||||||
FILE_VOB,
|
FILE_VOB,
|
||||||
FILE_WAV,
|
FILE_WAV,
|
||||||
|
@@ -411,7 +411,7 @@ bool CFlashUpdate::checkVersion4Update()
|
|||||||
if (allow_flash)
|
if (allow_flash)
|
||||||
UpdatesFilter.addFilter(FILEBROWSER_UPDATE_FILTER);
|
UpdatesFilter.addFilter(FILEBROWSER_UPDATE_FILTER);
|
||||||
|
|
||||||
std::string filters[] = {"bin", "txt", "opk", "ipk"};
|
std::string filters[] = {"bin", "txt", "opk", "ipk", "tgz"};
|
||||||
for(size_t i=0; i<sizeof(filters)/sizeof(filters[0]) ;i++)
|
for(size_t i=0; i<sizeof(filters)/sizeof(filters[0]) ;i++)
|
||||||
UpdatesFilter.addFilter(filters[i]);
|
UpdatesFilter.addFilter(filters[i]);
|
||||||
|
|
||||||
@@ -456,6 +456,13 @@ bool CFlashUpdate::checkVersion4Update()
|
|||||||
//!always leave here!
|
//!always leave here!
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
//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;
|
||||||
|
}
|
||||||
//set internal filetype
|
//set internal filetype
|
||||||
char const * ptr = rindex(filename.c_str(), '.');
|
char const * ptr = rindex(filename.c_str(), '.');
|
||||||
if(ptr) {
|
if(ptr) {
|
||||||
@@ -597,6 +604,18 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
free(buffer);
|
free(buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (fileType == 'Z')
|
||||||
|
{
|
||||||
|
showGlobalStatus(100);
|
||||||
|
ShowHint(LOCALE_MESSAGEBOX_INFO, "Start ofgwrite");
|
||||||
|
hide();
|
||||||
|
|
||||||
|
const char ofgwrite_tgz[] = "/bin/ofgwrite_tgz";
|
||||||
|
printf("[update] calling %s %s %s\n", ofgwrite_tgz, g_settings.update_dir.c_str(), filename.c_str() );
|
||||||
|
#ifndef DRYRUN
|
||||||
|
my_system(3, ofgwrite_tgz, g_settings.update_dir.c_str(), filename.c_str());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else // not image, install
|
else // not image, install
|
||||||
{
|
{
|
||||||
const char install_sh[] = "/bin/install.sh";
|
const char install_sh[] = "/bin/install.sh";
|
||||||
|
Reference in New Issue
Block a user