BPackageManager: Make _InstallationRepository() protected
This commit is contained in:
@@ -82,6 +82,9 @@ public:
|
|||||||
void Update(const char* const* packages,
|
void Update(const char* const* packages,
|
||||||
int packageCount);
|
int packageCount);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
InstalledRepository& InstallationRepository();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _HandleProblems();
|
void _HandleProblems();
|
||||||
void _AnalyzeResult();
|
void _AnalyzeResult();
|
||||||
@@ -100,8 +103,6 @@ private:
|
|||||||
int32 _FindBasePackage(const PackageList& packages,
|
int32 _FindBasePackage(const PackageList& packages,
|
||||||
const BPackageInfo& info);
|
const BPackageInfo& info);
|
||||||
|
|
||||||
InstalledRepository& _InstallationRepository();
|
|
||||||
|
|
||||||
void _AddInstalledRepository(
|
void _AddInstalledRepository(
|
||||||
InstalledRepository* repository);
|
InstalledRepository* repository);
|
||||||
void _AddRemoteRepository(BPackageRoster& roster,
|
void _AddRemoteRepository(BPackageRoster& roster,
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ BPackageManager::Uninstall(const char* const* packages, int packageCount)
|
|||||||
|
|
||||||
// determine the inverse base package closure for the found packages
|
// determine the inverse base package closure for the found packages
|
||||||
// TODO: Optimize!
|
// TODO: Optimize!
|
||||||
InstalledRepository& installationRepository = _InstallationRepository();
|
InstalledRepository& installationRepository = InstallationRepository();
|
||||||
bool foundAnotherPackage;
|
bool foundAnotherPackage;
|
||||||
do {
|
do {
|
||||||
foundAnotherPackage = false;
|
foundAnotherPackage = false;
|
||||||
@@ -274,6 +274,16 @@ BPackageManager::Update(const char* const* packages, int packageCount)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BPackageManager::InstalledRepository&
|
||||||
|
BPackageManager::InstallationRepository()
|
||||||
|
{
|
||||||
|
if (fInstalledRepositories.IsEmpty())
|
||||||
|
DIE("no installation repository");
|
||||||
|
|
||||||
|
return *fInstalledRepositories.LastItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BPackageManager::_HandleProblems()
|
BPackageManager::_HandleProblems()
|
||||||
{
|
{
|
||||||
@@ -295,7 +305,7 @@ BPackageManager::_AnalyzeResult()
|
|||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
DIE(error, "failed to compute packages to un/-install");
|
DIE(error, "failed to compute packages to un/-install");
|
||||||
|
|
||||||
InstalledRepository& installationRepository = _InstallationRepository();
|
InstalledRepository& installationRepository = InstallationRepository();
|
||||||
PackageList& packagesToActivate
|
PackageList& packagesToActivate
|
||||||
= installationRepository.PackagesToActivate();
|
= installationRepository.PackagesToActivate();
|
||||||
PackageList& packagesToDeactivate
|
PackageList& packagesToDeactivate
|
||||||
@@ -563,16 +573,6 @@ BPackageManager::_FindBasePackage(const PackageList& packages,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BPackageManager::InstalledRepository&
|
|
||||||
BPackageManager::_InstallationRepository()
|
|
||||||
{
|
|
||||||
if (fInstalledRepositories.IsEmpty())
|
|
||||||
DIE("no installation repository");
|
|
||||||
|
|
||||||
return *fInstalledRepositories.LastItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BPackageManager::_AddInstalledRepository(InstalledRepository* repository)
|
BPackageManager::_AddInstalledRepository(InstalledRepository* repository)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user