diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2013-04-03 19:34:47 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2013-04-03 19:34:47 +0200 |
commit | 887c6940d2afc9e3110f226e4d95fc72640e3ad6 (patch) | |
tree | bd9fd7dbb978cfec3cb48e8e06d78e0a614d6dfe /apt-pkg/pkgcache.cc | |
parent | aa0fe657e46b87cc692895a36df12e8b74bb27bb (diff) |
* apt-pkg/cacheiterators.h:
- provide DepIterator::IsSatisfied as a nicer shorthand for DepCheck
Diffstat (limited to 'apt-pkg/pkgcache.cc')
-rw-r--r-- | apt-pkg/pkgcache.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 879f34099..d7725563b 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -634,8 +634,7 @@ pkgCache::Version **pkgCache::DepIterator::AllTargets() const { if (IsIgnorable(I.ParentPkg()) == true) continue; - - if (Owner->VS->CheckDep(I.VerStr(),S->CompareOp,TargetVer()) == false) + if (IsSatisfied(I) == false) continue; Size++; @@ -648,8 +647,7 @@ pkgCache::Version **pkgCache::DepIterator::AllTargets() const { if (IsIgnorable(I) == true) continue; - - if (Owner->VS->CheckDep(I.ProvideVersion(),S->CompareOp,TargetVer()) == false) + if (IsSatisfied(I) == false) continue; Size++; @@ -757,6 +755,16 @@ bool pkgCache::DepIterator::IsMultiArchImplicit() const 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 /*{{{*/ // --------------------------------------------------------------------- /* */ |