X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b5dc97853ed1884269aa92a98f9f1e37d5591a14..29f7b36cd63f16ceab825531b5c131eac4b99f9b:/apt-pkg/algorithms.cc?ds=sidebyside diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 505ba59f7..21db98941 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: algorithms.cc,v 1.18 1999/06/04 02:31:37 jgg Exp $ +// $Id: algorithms.cc,v 1.20 1999/07/03 03:10:35 jgg Exp $ /* ###################################################################### Algorithms - A set of misc algorithms @@ -33,6 +33,11 @@ pkgSimulate::pkgSimulate(pkgDepCache &Cache) : pkgPackageManager(Cache), { Flags = new unsigned char[Cache.HeaderP->PackageCount]; memset(Flags,0,sizeof(*Flags)*Cache.HeaderP->PackageCount); + + // Fake a filename so as not to activate the media swapping + string Jnk = "SIMULATE"; + for (int I = 0; I != Cache.Head().PackageCount; I++) + FileNames[I] = Jnk; } /*}}}*/ // Simulate::Install - Simulate unpacking of a package /*{{{*/ @@ -755,10 +760,16 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) ((Cache[End] & pkgDepCache::DepGNow) == 0 && End->Type != pkgCache::Dep::Conflicts)) { + // Try a little harder to fix protected packages.. if ((Flags[I->ID] & Protected) == Protected) + { + if (DoUpgrade(Pkg) == true) + Scores[Pkg->ID] = Scores[I->ID]; continue; - - // See if a keep will do + } + + /* See if a keep will do, unless the package is protected, + then installing it will be necessary */ Cache.MarkKeep(I); if (Cache[I].InstBroken() == false) {