mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
COPKGManager: add functions isInstalled() and isUpgradable()
This commit is contained in:
@@ -782,6 +782,30 @@ bool COPKGManager::installPackage(const string& pkg_name, string options, bool f
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool COPKGManager::isInstalled(const string& pkg_name)
|
||||||
|
{
|
||||||
|
string package = pkg_name;
|
||||||
|
package = getBaseName(package);
|
||||||
|
|
||||||
|
map<string, struct pkg>::iterator it = pkg_map.find(package);
|
||||||
|
if (it != pkg_map.end())
|
||||||
|
if (it->second.installed)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool COPKGManager::isUpgradable(const string& pkg_name)
|
||||||
|
{
|
||||||
|
string package = pkg_name;
|
||||||
|
package = getBaseName(package);
|
||||||
|
|
||||||
|
map<string, struct pkg>::iterator it = pkg_map.find(package);
|
||||||
|
if (it != pkg_map.end())
|
||||||
|
if (it->second.upgradable)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void COPKGManager::showMenuConfigFeed(CMenuWidget *feed_menu)
|
void COPKGManager::showMenuConfigFeed(CMenuWidget *feed_menu)
|
||||||
{
|
{
|
||||||
|
@@ -76,6 +76,8 @@ class COPKGManager : public CMenuTarget
|
|||||||
};
|
};
|
||||||
void getPkgData(const int pkg_content_id);
|
void getPkgData(const int pkg_content_id);
|
||||||
std::string getBlankPkgName(const std::string& line);
|
std::string getBlankPkgName(const std::string& line);
|
||||||
|
bool isInstalled(const std::string& pkg_name);
|
||||||
|
bool isUpgradable(const std::string& pkg_name);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Gets an info from opkg command info or status from a package via keywords as std::string
|
* Gets an info from opkg command info or status from a package via keywords as std::string
|
||||||
|
Reference in New Issue
Block a user