diff options
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/cacheiterators.h | 1 | ||||
-rw-r--r-- | apt-pkg/depcache.cc | 14 | ||||
-rw-r--r-- | apt-pkg/pkgcache.cc | 11 |
3 files changed, 24 insertions, 2 deletions
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index 8f9f811da..0c9813c6d 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -287,6 +287,7 @@ class pkgCache::DepIterator : public Iterator<Dependency, DepIterator> { inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[S->ParentVer].ParentPkg);}; inline bool Reverse() const {return Type == DepRev;}; bool IsCritical() const; + bool IsNegative() const; void GlobOr(DepIterator &Start,DepIterator &End); Version **AllTargets() const; bool SmartTargetPkg(PkgIterator &Result) const; diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 474313a0d..34ead1726 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1145,8 +1145,18 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, /* If we are in an or group locate the first or that can succeed. We have already cached this.. */ - for (; Ors > 1 && (DepState[Start->ID] & DepCVer) != DepCVer; Ors--) - Start++; + for (; Ors > 1 && (DepState[Start->ID] & DepCVer) != DepCVer; --Ors) + ++Start; + if (Ors == 1 && (DepState[Start->ID] &DepCVer) != DepCVer && Start.IsNegative() == false) + { + if(DebugAutoInstall == true) + std::clog << OutputInDepth(Depth) << Start << " can't be satisfied!" << std::endl; + if (Start.IsCritical() == false) + continue; + // if the dependency was critical, we can't install it, so remove it again + MarkDelete(Pkg,false,Depth + 1, false); + return; + } /* This bit is for processing the possibilty of an install/upgrade fixing the problem */ diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 862d05348..6c12b4581 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -530,6 +530,17 @@ bool pkgCache::DepIterator::IsCritical() const return false; } /*}}}*/ +// DepIterator::IsNegative - Returns true if the dep is a negative one /*{{{*/ +// --------------------------------------------------------------------- +/* Some dependencies are positive like Depends and Recommends, others + are negative like Conflicts which can and should be handled differently */ +bool pkgCache::DepIterator::IsNegative() const +{ + return S->Type == Dep::DpkgBreaks || + S->Type == Dep::Conflicts || + S->Type == Dep::Obsoletes; +} + /*}}}*/ // DepIterator::SmartTargetPkg - Resolve dep target pointers w/provides /*{{{*/ // --------------------------------------------------------------------- /* This intellegently looks at dep target packages and tries to figure |