BSolver::Install(): Add optional unmatched specifier return param
This commit is contained in:
parent
71293f8b03
commit
0d8ed3f2a8
@ -14,6 +14,7 @@ namespace BPackageKit {
|
||||
|
||||
|
||||
class BSolverPackage;
|
||||
class BSolverPackageSpecifier;
|
||||
class BSolverPackageSpecifierList;
|
||||
class BSolverProblem;
|
||||
class BSolverRepository;
|
||||
@ -47,7 +48,9 @@ public:
|
||||
|
||||
virtual status_t Install(
|
||||
const BSolverPackageSpecifierList&
|
||||
packages) = 0;
|
||||
packages,
|
||||
const BSolverPackageSpecifier** _unmatched
|
||||
= NULL) = 0;
|
||||
virtual status_t VerifyInstallation() = 0;
|
||||
|
||||
bool HasProblems() const
|
||||
|
@ -284,8 +284,12 @@ LibsolvSolver::FindPackages(const char* searchString, uint32 flags,
|
||||
|
||||
|
||||
status_t
|
||||
LibsolvSolver::Install(const BSolverPackageSpecifierList& packages)
|
||||
LibsolvSolver::Install(const BSolverPackageSpecifierList& packages,
|
||||
const BSolverPackageSpecifier** _unmatched)
|
||||
{
|
||||
if (_unmatched != NULL)
|
||||
*_unmatched = NULL;
|
||||
|
||||
if (packages.IsEmpty())
|
||||
return B_BAD_VALUE;
|
||||
|
||||
@ -327,8 +331,11 @@ LibsolvSolver::Install(const BSolverPackageSpecifierList& packages)
|
||||
| SELECTION_CANON | SELECTION_DOTARCH | SELECTION_REL;
|
||||
/*int matchFlags =*/ selection_make(fPool, &matchingPackages,
|
||||
specifier.SelectString().String(), flags);
|
||||
if (matchingPackages.count == 0)
|
||||
if (matchingPackages.count == 0) {
|
||||
if (_unmatched != NULL)
|
||||
*_unmatched = &specifier;
|
||||
return B_NAME_NOT_FOUND;
|
||||
}
|
||||
// TODO: We might want to add support for restricting to certain repositories.
|
||||
#if 0
|
||||
// restrict to the matching repository
|
||||
|
@ -40,7 +40,9 @@ public:
|
||||
|
||||
virtual status_t Install(
|
||||
const BSolverPackageSpecifierList&
|
||||
packages);
|
||||
packages,
|
||||
const BSolverPackageSpecifier** _unmatched
|
||||
= NULL);
|
||||
virtual status_t VerifyInstallation();
|
||||
|
||||
virtual int32 CountProblems() const;
|
||||
|
Loading…
Reference in New Issue
Block a user