// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: depcache.cc,v 1.9 1998/12/07 23:54:42 jgg Exp $
+// $Id: depcache.cc,v 1.14 1998/12/22 08:01:04 jgg Exp $
/* ######################################################################
Dependency Cache - Caches Dependency information.
{
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 /*{{{*/
// 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;
}
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;