BPackageManager: Add VerifyInstallation()

This commit is contained in:
Ingo Weinhold 2013-09-10 18:55:44 +02:00
parent 7e0d2c4f94
commit c032903abc
2 changed files with 29 additions and 0 deletions

View File

@ -88,6 +88,8 @@ public:
void Update(const BSolverPackageSpecifierList& void Update(const BSolverPackageSpecifierList&
packages); packages);
void VerifyInstallation();
protected: protected:
InstalledRepository& InstallationRepository(); InstalledRepository& InstallationRepository();

View File

@ -286,6 +286,33 @@ BPackageManager::Update(const BSolverPackageSpecifierList& packages)
} }
void
BPackageManager::VerifyInstallation()
{
Init(B_ADD_INSTALLED_REPOSITORIES | B_ADD_REMOTE_REPOSITORIES
| B_REFRESH_REPOSITORIES);
for (;;) {
status_t error = fSolver->VerifyInstallation();
if (error != B_OK)
DIE(error, "failed to compute package dependencies");
_HandleProblems();
// (virtually) apply the result to this repository
_AnalyzeResult();
InstallationRepository().ApplyChanges();
// verify the next specific respository
if (!_NextSpecificInstallationLocation())
break;
}
_ConfirmChanges();
_ApplyPackageChanges();
}
BPackageManager::InstalledRepository& BPackageManager::InstalledRepository&
BPackageManager::InstallationRepository() BPackageManager::InstallationRepository()
{ {