summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcache.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2013-04-03 19:34:47 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2013-04-03 19:34:47 +0200
commit887c6940d2afc9e3110f226e4d95fc72640e3ad6 (patch)
treebd9fd7dbb978cfec3cb48e8e06d78e0a614d6dfe /apt-pkg/pkgcache.cc
parentaa0fe657e46b87cc692895a36df12e8b74bb27bb (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.cc16
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 /*{{{*/
// ---------------------------------------------------------------------
/* */