diff --git a/headers/private/package/manager/PackageManager.h b/headers/private/package/manager/PackageManager.h index b8ef231c63..3ad1c04b9d 100644 --- a/headers/private/package/manager/PackageManager.h +++ b/headers/private/package/manager/PackageManager.h @@ -88,6 +88,8 @@ public: void Update(const BSolverPackageSpecifierList& packages); + void VerifyInstallation(); + protected: InstalledRepository& InstallationRepository(); diff --git a/src/kits/package/manager/PackageManager.cpp b/src/kits/package/manager/PackageManager.cpp index 5e638cc1dc..bfcc4bb4c3 100644 --- a/src/kits/package/manager/PackageManager.cpp +++ b/src/kits/package/manager/PackageManager.cpp @@ -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::InstallationRepository() {