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