diff --git a/headers/os/package/solver/Solver.h b/headers/os/package/solver/Solver.h index 88914bc512..bc558c9e86 100644 --- a/headers/os/package/solver/Solver.h +++ b/headers/os/package/solver/Solver.h @@ -34,6 +34,11 @@ public: B_FIND_INSTALLED_ONLY = 0x20, }; + // VerifyInstallation() flags + enum { + B_VERIFY_ALLOW_UNINSTALL = 0x01, + }; + public: virtual ~BSolver(); @@ -67,7 +72,7 @@ public: bool installNotYetInstalled, const BSolverPackageSpecifier** _unmatched = NULL) = 0; - virtual status_t VerifyInstallation() = 0; + virtual status_t VerifyInstallation(uint32 flags = 0) = 0; bool HasProblems() const { return CountProblems() > 0; } diff --git a/src/kits/package/solver/LibsolvSolver.cpp b/src/kits/package/solver/LibsolvSolver.cpp index 75592b4dd1..4e8d169941 100644 --- a/src/kits/package/solver/LibsolvSolver.cpp +++ b/src/kits/package/solver/LibsolvSolver.cpp @@ -446,7 +446,7 @@ LibsolvSolver::Update(const BSolverPackageSpecifierList& packages, status_t -LibsolvSolver::VerifyInstallation() +LibsolvSolver::VerifyInstallation(uint32 flags) { if (fInstalledRepository == NULL) return B_BAD_VALUE; @@ -467,6 +467,8 @@ LibsolvSolver::VerifyInstallation() _SetJobsSolverMode(SOLVER_VERIFY); _InitSolver(); + if ((flags & B_VERIFY_ALLOW_UNINSTALL) != 0) + solver_set_flag(fSolver, SOLVER_FLAG_ALLOW_UNINSTALL, 1); return _Solve(); } diff --git a/src/kits/package/solver/LibsolvSolver.h b/src/kits/package/solver/LibsolvSolver.h index 8878e11b9e..084252938a 100644 --- a/src/kits/package/solver/LibsolvSolver.h +++ b/src/kits/package/solver/LibsolvSolver.h @@ -57,7 +57,7 @@ public: bool installNotYetInstalled, const BSolverPackageSpecifier** _unmatched = NULL); - virtual status_t VerifyInstallation(); + virtual status_t VerifyInstallation(uint32 flags = 0); virtual int32 CountProblems() const; virtual BSolverProblem* ProblemAt(int32 index) const;