X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/981d20eb7e036152b04238036d1ce215b9b75ccf..e5a1f2ff4cd1300364c7c644958583a8af704173:/apt-pkg/depcache.cc diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 7f9ded720..727f01462 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: depcache.cc,v 1.10 1998/12/08 01:34:07 jgg Exp $ +// $Id: depcache.cc,v 1.15 1999/03/26 07:38:43 jgg Exp $ /* ###################################################################### Dependency Cache - Caches Dependency information. @@ -104,14 +104,15 @@ pkgDepCache::VerIterator pkgDepCache::GetCandidateVer(PkgIterator Pkg) // Try to use an explicit target if (Pkg->TargetVer == 0) { - /* Not source versions cannot be a candidate version unless they - are already installed */ + /* Not source/not automatic versions cannot be a candidate version + unless they are already installed */ for (VerIterator I = Pkg.VersionList(); I.end() == false; I++) { if (Pkg.CurrentVer() == I) return I; for (VerFileIterator J = I.FileList(); J.end() == false; J++) - if ((J.File()->Flags & Flag::NotSource) == 0) + if ((J.File()->Flags & Flag::NotSource) == 0 && + (J.File()->Flags & Flag::NotAutomatic) == 0) return I; } @@ -214,7 +215,8 @@ void pkgDepCache::AddSizes(const PkgIterator &Pkg,long Mult) { StateCache &P = PkgState[Pkg->ID]; - if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure) + if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure && + P.Keep() == true) { iUsrSize += Mult*P.InstVerIter(*this)->InstalledSize; return; @@ -588,7 +590,10 @@ void pkgDepCache::MarkDelete(PkgIterator const &Pkg) RemoveSizes(Pkg); RemoveStates(Pkg); - P.Mode = ModeDelete; + if (Pkg->CurrentVer == 0) + P.Mode = ModeKeep; + else + P.Mode = ModeDelete; P.InstallVer = 0; P.Flags &= Flag::Auto;