mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 17:01:08 +02:00
COPKGManager: add functions isInstalled() and isUpgradable()
Origin commit data
------------------
Commit: ce3c4d3b04
Author: Thilo Graf <dbt@novatux.de>
Date: 2015-02-07 (Sat, 07 Feb 2015)
This commit is contained in:
@@ -782,6 +782,30 @@ bool COPKGManager::installPackage(const string& pkg_name, string options, bool f
|
||||
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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user