BPackageManager: Make _InstallationRepository() protected
This commit is contained in:
@@ -82,6 +82,9 @@ public:
|
||||
void Update(const char* const* packages,
|
||||
int packageCount);
|
||||
|
||||
protected:
|
||||
InstalledRepository& InstallationRepository();
|
||||
|
||||
private:
|
||||
void _HandleProblems();
|
||||
void _AnalyzeResult();
|
||||
@@ -100,8 +103,6 @@ private:
|
||||
int32 _FindBasePackage(const PackageList& packages,
|
||||
const BPackageInfo& info);
|
||||
|
||||
InstalledRepository& _InstallationRepository();
|
||||
|
||||
void _AddInstalledRepository(
|
||||
InstalledRepository* repository);
|
||||
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
|
||||
// TODO: Optimize!
|
||||
InstalledRepository& installationRepository = _InstallationRepository();
|
||||
InstalledRepository& installationRepository = InstallationRepository();
|
||||
bool foundAnotherPackage;
|
||||
do {
|
||||
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
|
||||
BPackageManager::_HandleProblems()
|
||||
{
|
||||
@@ -295,7 +305,7 @@ BPackageManager::_AnalyzeResult()
|
||||
if (error != B_OK)
|
||||
DIE(error, "failed to compute packages to un/-install");
|
||||
|
||||
InstalledRepository& installationRepository = _InstallationRepository();
|
||||
InstalledRepository& installationRepository = InstallationRepository();
|
||||
PackageList& packagesToActivate
|
||||
= installationRepository.PackagesToActivate();
|
||||
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
|
||||
BPackageManager::_AddInstalledRepository(InstalledRepository* repository)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user