From ad476ea4b2309e56a00bb59300bc7bddff022e9c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 11 Apr 2021 00:13:36 +0200 Subject: [PATCH] add --enable-pkg-management configure switch; default=no Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fc100fdd44831453556fb4c95220e07779e622b9 Author: vanhofen Date: 2021-04-11 (Sun, 11 Apr 2021) Origin message was: ------------------ - add --enable-pkg-management configure switch; default=no --- configure.ac | 5 +++++ src/gui/Makefile.am | 8 ++++++-- src/gui/start_wizard.cpp | 4 ++++ src/gui/update.cpp | 4 ++++ src/gui/update_menue.cpp | 4 ++++ src/gui/update_settings.cpp | 12 +++++++----- src/neutrino.cpp | 9 +++++++-- src/system/settings.h | 2 ++ 8 files changed, 39 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index ce1ec34ac..40755e9fb 100644 --- a/configure.ac +++ b/configure.ac @@ -258,6 +258,11 @@ AC_ARG_ENABLE(extupdate, AC_DEFINE(ENABLE_EXTUPDATE, 1, [enable extended update routine])) AM_CONDITIONAL(ENABLE_EXTUPDATE, test "$enable_extupdate" = "yes") +AC_ARG_ENABLE(pkg-management, + AS_HELP_STRING([--enable-pkg-management], [enable package management @<:@default=no@:>@]), + AC_DEFINE(ENABLE_PKG_MANAGEMENT, 1, [enable package management])) +AM_CONDITIONAL(ENABLE_PKG_MANAGEMENT, test "$enable_pkg_management" = "yes") + AC_ARG_ENABLE(lua, AS_HELP_STRING([--enable-lua], [enable Lua support @<:@default=yes@:>@]), [enable_lua="$enableval"], diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index e6d1fc937..1ba0263d1 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -75,7 +75,6 @@ libneutrino_gui_a_SOURCES = \ network_service.cpp \ network_setup.cpp \ nfs.cpp \ - opkg_manager.cpp \ osd_helpers.cpp \ osd_progressbar_setup.cpp \ osd_setup.cpp \ @@ -105,7 +104,6 @@ libneutrino_gui_a_SOURCES = \ timeosd.cpp \ update.cpp \ update_check.cpp \ - update_check_packages.cpp \ update_menue.cpp \ update_settings.cpp \ user_menue.cpp \ @@ -118,6 +116,12 @@ libneutrino_gui_a_SOURCES = \ xmltv_setup.cpp \ zapit_setup.cpp +if ENABLE_PKG_MANAGEMENT +libneutrino_gui_a_SOURCES += \ + opkg_manager.cpp \ + update_check_packages.cpp +endif + if ENABLE_LCD4LINUX libneutrino_gui_a_SOURCES += \ lcd4l_setup.cpp diff --git a/src/gui/start_wizard.cpp b/src/gui/start_wizard.cpp index 6c640bfd6..aab9c9952 100644 --- a/src/gui/start_wizard.cpp +++ b/src/gui/start_wizard.cpp @@ -48,7 +48,9 @@ #include "scan_setup.h" #include "settings_manager.h" #include "videosettings.h" +#if ENABLE_PKG_MANAGEMENT #include "opkg_manager.h" +#endif #include #include @@ -140,6 +142,7 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/) CNetworkSetup::getInstance()->setWizardMode(SNeutrinoSettings::WIZARD_OFF); } +#if ENABLE_PKG_MANAGEMENT //package update check if(advanced && res != menu_return::RETURN_EXIT_ALL) { @@ -154,6 +157,7 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/) g_settings.softupdate_autocheck_packages = true; } } +#endif bool init_settings = false; if (CFEManager::getInstance()->haveSat()) diff --git a/src/gui/update.cpp b/src/gui/update.cpp index 38d62c37f..fb4e2e009 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -49,7 +49,9 @@ #include #include +#if ENABLE_PKG_MANAGEMENT #include +#endif #include #include @@ -494,6 +496,7 @@ bool CFlashUpdate::checkVersion4Update() } hide(); +#if ENABLE_PKG_MANAGEMENT //package install: if (file_selected->getType() == CFile::FILE_PKG_PACKAGE){ COPKGManager opkg; @@ -509,6 +512,7 @@ bool CFlashUpdate::checkVersion4Update() //!always leave here! return false; } +#endif //set internal filetype char const * ptr = rindex(filename.c_str(), '.'); diff --git a/src/gui/update_menue.cpp b/src/gui/update_menue.cpp index 0ca6da3e8..da70899f1 100644 --- a/src/gui/update_menue.cpp +++ b/src/gui/update_menue.cpp @@ -41,7 +41,9 @@ #include "update_menue.h" #include "update_settings.h" +#if ENABLE_PKG_MANAGEMENT #include "gui/opkg_manager.h" +#endif #include #include #include @@ -81,6 +83,7 @@ int CSoftwareUpdate::showSoftwareUpdate() softUpdate.addIntroItems(LOCALE_SERVICEMENU_UPDATE); unsigned int inetkey = CRCInput::RC_red; +#if ENABLE_PKG_MANAGEMENT if (COPKGManager::hasOpkgSupport()) { //firmware update via opkg mf = new CMenuDForwarder(LOCALE_OPKG_TITLE, true, NULL, new COPKGManager(), NULL, CRCInput::RC_red); @@ -88,6 +91,7 @@ int CSoftwareUpdate::showSoftwareUpdate() softUpdate.addItem(mf); inetkey = CRCInput::convertDigitToKey(1); } +#endif bool allow_update = !CRecordManager::getInstance()->RecordingStatus() || CRecordManager::getInstance()->TimeshiftOnly(); diff --git a/src/gui/update_settings.cpp b/src/gui/update_settings.cpp index f8d6f0e3b..91d72984c 100644 --- a/src/gui/update_settings.cpp +++ b/src/gui/update_settings.cpp @@ -39,15 +39,16 @@ #include #include #include +#if ENABLE_PKG_MANAGEMENT #include #include +#endif #include #include #include #include #include - CUpdateSettings::CUpdateSettings() { width = 40; @@ -161,8 +162,8 @@ int CUpdateSettings::initMenu() autocheck = new CMenuOptionChooser(LOCALE_FLASHUPDATE_AUTOCHECK, &g_settings.softupdate_autocheck, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); autocheck->setHint("", LOCALE_MENU_HINT_AUTO_UPDATE_CHECK); +#if ENABLE_PKG_MANAGEMENT CMenuOptionChooser *package_autocheck = NULL; -#if 0 if (COPKGManager::hasOpkgSupport()){ package_autocheck = new CMenuOptionChooser(LOCALE_FLASHUPDATE_AUTOCHECK_PACKAGES, &g_settings.softupdate_autocheck_packages, AUTOUPDATE_CHECK_OPTIONS, auto_update_options_count, true, this); package_autocheck->setHint("", LOCALE_MENU_HINT_AUTO_UPDATE_CHECK); @@ -170,8 +171,7 @@ int CUpdateSettings::initMenu() #endif w_upsettings.addItem(fw_update_dir); - if (fw_url) - w_upsettings.addItem(fw_url); + w_upsettings.addItem(fw_url); #if ENABLE_EXTUPDATE w_upsettings.addItem(name_backup); #ifndef BOXMODEL_CST_HD2 @@ -182,8 +182,10 @@ int CUpdateSettings::initMenu() #endif if (autocheck) w_upsettings.addItem(autocheck); +#if ENABLE_PKG_MANAGEMENT if (package_autocheck) w_upsettings.addItem(package_autocheck); +#endif #if 0 w_upsettings.addItem(apply_kernel); #endif @@ -201,7 +203,7 @@ bool CUpdateSettings::changeNotify(const neutrino_locale_t OptionName, void * /* CFlashUpdateCheck::getInstance()->stopThread(); if (g_settings.softupdate_autocheck) CFlashUpdateCheck::getInstance()->startThread(); -#if 0 +#if ENABLE_PKG_MANAGEMENT CUpdateCheck::getInstance()->stopTimer(); if (g_settings.softupdate_autocheck) CUpdateCheck::getInstance()->startThread(); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 9c9fcc83b..fe0eed0d6 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -98,7 +98,9 @@ #include "gui/update_ext.h" #include "gui/update.h" #include "gui/update_check.h" +#if ENABLE_PKG_MANAGEMENT #include "gui/update_check_packages.h" +#endif #include "gui/videosettings.h" #include "gui/audio_select.h" #include "gui/weather.h" @@ -405,7 +407,9 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.show_ecm_pos = configfile.getInt32("show_ecm_pos" , 0); g_settings.softupdate_autocheck = configfile.getBool("softupdate_autocheck" , false); +#if ENABLE_PKG_MANAGEMENT g_settings.softupdate_autocheck_packages = configfile.getInt32("softupdate_autocheck_packages" , false); +#endif // video int vid_Mode_default = VIDEO_STD_720P50; @@ -1944,7 +1948,9 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32 ("softupdate_name_mode_apply", g_settings.softupdate_name_mode_apply); configfile.setInt32 ("softupdate_name_mode_backup", g_settings.softupdate_name_mode_backup); configfile.setBool("softupdate_autocheck", g_settings.softupdate_autocheck); +#if ENABLE_PKG_MANAGEMENT configfile.setInt32("softupdate_autocheck_packages", g_settings.softupdate_autocheck_packages); +#endif configfile.setInt32("flashupdate_createimage_add_var", g_settings.flashupdate_createimage_add_var); configfile.setInt32("flashupdate_createimage_add_root1", g_settings.flashupdate_createimage_add_root1); @@ -3132,7 +3138,6 @@ TIMER_START(); TIMER_STOP("################################## after all ##################################"); if (g_settings.softupdate_autocheck) { #if 0 - hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_CHECKUPDATE_INTERNET)); hintBox->paint(); CFlashUpdate flash; @@ -3147,7 +3152,7 @@ TIMER_STOP("################################## after all ####################### CFlashUpdateCheck::getInstance()->startThread(); //CUpdateCheck::getInstance()->startThread(); } -#if 0 +#if ENABLE_PKG_MANAGEMENT if (g_settings.softupdate_autocheck_packages) CUpdateCheckPackages::getInstance()->startThread(); #endif diff --git a/src/system/settings.h b/src/system/settings.h index a227aecba..144e4348d 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -833,7 +833,9 @@ struct SNeutrinoSettings std::string softupdate_proxyusername; std::string softupdate_proxypassword; int softupdate_autocheck; +#if ENABLE_PKG_MANAGEMENT int softupdate_autocheck_packages; +#endif int softupdate_name_mode_apply; int softupdate_name_mode_backup; int apply_settings;