opkg_manager: ensure update of package list after menu update

This commit is contained in:
2021-05-14 17:10:06 +02:00
parent 783426588c
commit 54bd062ff1
2 changed files with 11 additions and 2 deletions

View File

@@ -136,8 +136,7 @@ void COPKGManager::init(int wizard_mode)
list_upgradeable_done = false;
expert_mode = false;
local_dir = &g_settings.update_dir_opkg;
v_bad_pattern = getBadPackagePatternList();
v_good_pattern = getGoodPackagePatternList();
initPackagePatternLists();
silent = false;
num_updates = 0;
@@ -359,6 +358,14 @@ static const struct button_label COPKGManagerFooterButtonsExpert[COPKGManagerFoo
{ NEUTRINO_ICON_BUTTON_BLUE, LOCALE_OPKG_BUTTON_UNINSTALL }
};
void COPKGManager::initPackagePatternLists()
{
v_bad_pattern.clear();
v_bad_pattern = getBadPackagePatternList();
v_good_pattern.clear();
v_good_pattern = getGoodPackagePatternList();
}
vector<string> COPKGManager::getBadPackagePatternList()
{
return COPKGManager::getPackagePatternList(OPKG_BAD_LIST);
@@ -477,6 +484,7 @@ void COPKGManager::updateMenu()
bool upgradesAvailable = false;
getPkgData(CMD_LIST_INSTALLED);
getPkgData(CMD_LIST_UPGRADEABLE);
initPackagePatternLists();
for (map<string, struct pkg>::iterator it = pkg_map.begin(); it != pkg_map.end(); ++it) {
/* this should no longer trigger at all */
if (!isPermittedPackage(it->second.name))

View File

@@ -143,6 +143,7 @@ class COPKGManager : public CMenuTarget
OPKG_GOOD_LIST = 1
}opkg_pattern_list_t;
void initPackagePatternLists();
static std::vector<std::string> getPackagePatternList(opkg_pattern_list_t type);
//!Returns a vector with possible filter entries from OPKG_BAD_PATTERN_LIST_FILE or OPKG_GOOD_PATTERN_LIST_FILE