From 359e46db58b85497fd232fbe912b8a62e77079c5 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 11 May 2011 16:05:30 +0200 Subject: convert a lot of places to use IsNegative instead of checking by hand for the three different dependencies --- apt-pkg/pkgcache.cc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'apt-pkg/pkgcache.cc') diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 6c12b4581..38e4e904e 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -521,9 +521,7 @@ std::string pkgCache::PkgIterator::FullName(bool const &Pretty) const conflicts (including dpkg's Breaks fields). */ bool pkgCache::DepIterator::IsCritical() const { - if (S->Type == pkgCache::Dep::Conflicts || - S->Type == pkgCache::Dep::DpkgBreaks || - S->Type == pkgCache::Dep::Obsoletes || + if (IsNegative() == true || S->Type == pkgCache::Dep::Depends || S->Type == pkgCache::Dep::PreDepends) return true; @@ -618,9 +616,7 @@ pkgCache::Version **pkgCache::DepIterator::AllTargets() const if (Owner->VS->CheckDep(I.VerStr(),S->CompareOp,TargetVer()) == false) continue; - if ((S->Type == pkgCache::Dep::Conflicts || - S->Type == pkgCache::Dep::DpkgBreaks || - S->Type == pkgCache::Dep::Obsoletes) && + if (IsNegative() == true && ParentPkg() == I.ParentPkg()) continue; @@ -635,9 +631,7 @@ pkgCache::Version **pkgCache::DepIterator::AllTargets() const if (Owner->VS->CheckDep(I.ProvideVersion(),S->CompareOp,TargetVer()) == false) continue; - if ((S->Type == pkgCache::Dep::Conflicts || - S->Type == pkgCache::Dep::DpkgBreaks || - S->Type == pkgCache::Dep::Obsoletes) && + if (IsNegative() == true && ParentPkg() == I.OwnerPkg()) continue; -- cgit v1.2.3-70-g09d2