X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/d38b7b3d803a719b189df80820aeda6a818f4909..65a1e968442361247b646dc61843f841235114e0:/apt-pkg/depcache.cc diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index b3a70d239..81127efb9 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.7 1998/11/23 07:02:59 jgg Exp $ +// $Id: depcache.cc,v 1.14 1998/12/22 08:01:04 jgg Exp $ /* ###################################################################### Dependency Cache - Caches Dependency information. @@ -25,6 +25,12 @@ pkgDepCache::pkgDepCache(MMap &Map,OpProgress &Prog) : { if (_error->PendingError() == false) Init(&Prog); +} +pkgDepCache::pkgDepCache(MMap &Map) : + pkgCache(Map), PkgState(0), DepState(0) +{ + if (_error->PendingError() == false) + Init(0); } /*}}}*/ // DepCache::~pkgDepCache - Destructor /*{{{*/ @@ -98,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; } @@ -208,6 +215,12 @@ void pkgDepCache::AddSizes(const PkgIterator &Pkg,long Mult) { StateCache &P = PkgState[Pkg->ID]; + if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure) + { + iUsrSize += Mult*P.InstVerIter(*this)->InstalledSize; + return; + } + // Compute the size data if (P.NewInstall() == true) { @@ -227,7 +240,8 @@ void pkgDepCache::AddSizes(const PkgIterator &Pkg,long Mult) } // Reinstall - if (Pkg.State() == pkgCache::PkgIterator::NeedsUnpack) + if (Pkg.State() == pkgCache::PkgIterator::NeedsUnpack && + P.Delete() == false) { iDownloadSize += Mult*P.InstVerIter(*this)->Size; return; @@ -305,6 +319,7 @@ void pkgDepCache::BuildGroupOrs(VerIterator const &V) State = ~State; // Add to the group if we are within an or.. + State &= 0x7; Group |= State; State |= Group << 3; if ((D->CompareOp & Dep::Or) != Dep::Or) @@ -574,7 +589,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;