PkgIterator Pkg = Dep.TargetPkg();
// Check the base package
if (Type == NowVersion && Pkg->CurrentVer != 0)
- if (VS().CheckDep(Pkg.CurrentVer().VerStr(),Dep->CompareOp,
- Dep.TargetVer()) == true)
+ if (Dep.IsSatisfied(Pkg.CurrentVer()) == true)
return true;
if (Type == InstallVersion && PkgState[Pkg->ID].InstallVer != 0)
- if (VS().CheckDep(PkgState[Pkg->ID].InstVerIter(*this).VerStr(),
- Dep->CompareOp,Dep.TargetVer()) == true)
+ if (Dep.IsSatisfied(PkgState[Pkg->ID].InstVerIter(*this)) == true)
return true;
if (Type == CandidateVersion && PkgState[Pkg->ID].CandidateVer != 0)
- if (VS().CheckDep(PkgState[Pkg->ID].CandidateVerIter(*this).VerStr(),
- Dep->CompareOp,Dep.TargetVer()) == true)
+ if (Dep.IsSatisfied(PkgState[Pkg->ID].CandidateVerIter(*this)) == true)
return true;
}
}
// Compare the versions.
- if (VS().CheckDep(P.ProvideVersion(),Dep->CompareOp,Dep.TargetVer()) == true)
+ if (Dep.IsSatisfied(P) == true)
{
Res = P.OwnerPkg();
return true;
{
APT::VersionList verlist;
pkgCache::VerIterator Cand = PkgState[Start.TargetPkg()->ID].CandidateVerIter(*this);
- if (Cand.end() == false && VS().CheckDep(Cand.VerStr(), Start->CompareOp, Start.TargetVer()) == true)
+ if (Cand.end() == false && Start.IsSatisfied(Cand) == true)
verlist.insert(Cand);
for (PrvIterator Prv = Start.TargetPkg().ProvidesList(); Prv.end() != true; ++Prv)
{
pkgCache::VerIterator V = Prv.OwnerVer();
pkgCache::VerIterator Cand = PkgState[Prv.OwnerPkg()->ID].CandidateVerIter(*this);
- if (Cand.end() == true || V != Cand ||
- VS().CheckDep(Prv.ProvideVersion(), Start->CompareOp, Start.TargetVer()) == false)
+ if (Cand.end() == true || V != Cand || Start.IsSatisfied(Prv) == false)
continue;
verlist.insert(Cand);
}
if (Cand.end() == true)
continue;
// check if the current candidate is enough for the versioned dependency - and installable?
- if (VS().CheckDep(P.CandVersion(), Start->CompareOp, Start.TargetVer()) == true &&
+ if (Start.IsSatisfied(Cand) == true &&
(VersionState(Cand.DependsList(), DepInstall, DepCandMin, DepCandPolicy) & DepCandMin) == DepCandMin)
{
itsFine = true;
V = Match.Find(D.TargetPkg());
// check if the version from this release could satisfy the dependency
- if (V.end() == true || VS().CheckDep(V.VerStr(), D->CompareOp, D.TargetVer()) == false)
+ if (V.end() == true || D.IsSatisfied(V) == false)
{
if (stillOr == true)
continue;
for(VerIterator V = d.TargetPkg().VersionList();
!V.end(); ++V)
{
- if(_system->VS->CheckDep(V.VerStr(), d->CompareOp, d.TargetVer()))
+ if(d.IsSatisfied(V))
{
if(debug_autoremove)
{
for(PrvIterator prv=d.TargetPkg().ProvidesList();
!prv.end(); ++prv)
{
- if(_system->VS->CheckDep(prv.ProvideVersion(), d->CompareOp,
- d.TargetVer()))
+ if(d.IsSatisfied(prv))
{
if(debug_autoremove)
{
{
if (IsIgnorable(I.ParentPkg()) == true)
continue;
-
- if (Owner->VS->CheckDep(I.VerStr(),S->CompareOp,TargetVer()) == false)
+ if (IsSatisfied(I) == false)
continue;
Size++;
{
if (IsIgnorable(I) == true)
continue;
-
- if (Owner->VS->CheckDep(I.ProvideVersion(),S->CompareOp,TargetVer()) == false)
+ if (IsSatisfied(I) == false)
continue;
Size++;
return false;
}
/*}}}*/
+// DepIterator::IsSatisfied - check if a version satisfied the dependency /*{{{*/
+bool pkgCache::DepIterator::IsSatisfied(VerIterator const &Ver) const
+{
+ return Owner->VS->CheckDep(Ver.VerStr(),S->CompareOp,TargetVer());
+}
+bool pkgCache::DepIterator::IsSatisfied(PrvIterator const &Prv) const
+{
+ return Owner->VS->CheckDep(Prv.ProvideVersion(),S->CompareOp,TargetVer());
+}
+ /*}}}*/
// ostream operator to handle string representation of a dependecy /*{{{*/
// ---------------------------------------------------------------------
/* */