X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/9d4c8f671af479cba90e1db2f68d9abf9daaa4a4..a62f8bb9110edd33cebe3968ab349657a99fa00a:/apt-pkg/packagemanager.cc diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index 28a8d7fb2..fad40c46a 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: packagemanager.cc,v 1.20 1999/08/12 05:59:54 jgg Exp $ +// $Id: packagemanager.cc,v 1.22 1999/10/22 05:58:54 jgg Exp $ /* ###################################################################### Package Manager - Abstacts the package manager @@ -157,6 +157,7 @@ bool pkgPackageManager::CreateOrderList() if ((Cache[I].Keep() == true || Cache[I].InstVerIter(Cache) == I.CurrentVer()) && I.State() == pkgCache::PkgIterator::NeedsNothing && + (Cache[I].iFlags & pkgDepCache::ReInstall) != pkgDepCache::ReInstall && (I.Purge() != false || Cache[I].Mode != pkgDepCache::ModeDelete || (Cache[I].iFlags & pkgDepCache::Purge) != pkgDepCache::Purge)) continue; @@ -414,12 +415,17 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg) /* See if this packages install version has any predependencies that are not met by 'now' packages. */ for (DepIterator D = Cache[Pkg].InstVerIter(Cache).DependsList(); - D.end() == false; D++) + D.end() == false; ) { - if (D->Type == pkgCache::Dep::PreDepends) + // Compute a single dependency element (glob or) + pkgCache::DepIterator Start; + pkgCache::DepIterator End; + D.GlobOr(Start,End); + + while (End->Type == pkgCache::Dep::PreDepends) { // Look for possible ok targets. - Version **VList = D.AllTargets(); + Version **VList = Start.AllTargets(); bool Bad = true; for (Version **I = VList; *I != 0 && Bad == true; I++) { @@ -450,18 +456,24 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg) } delete [] VList; - - if (Bad == true) - return _error->Error("Internal Error, Couldn't configure a pre-depend"); - continue; + /* If this or element did not match then continue on to the + next or element until a matching element is found*/ + if (Bad == true) + { + if (Start == End) + return _error->Error("Internal Error, Couldn't configure a pre-depend"); + Start++; + } + else + break; } - if (D->Type == pkgCache::Dep::Conflicts) + if (End->Type == pkgCache::Dep::Conflicts) { /* Look for conflicts. Two packages that are both in the install state cannot conflict so we don't check.. */ - Version **VList = D.AllTargets(); + Version **VList = End.AllTargets(); for (Version **I = VList; *I != 0; I++) { VerIterator Ver(Cache,*I); @@ -545,7 +557,9 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall() } // Sanity check - if (Cache[Pkg].Keep() == true && Pkg.State() == pkgCache::PkgIterator::NeedsNothing) + if (Cache[Pkg].Keep() == true && + Pkg.State() == pkgCache::PkgIterator::NeedsNothing && + (Cache[Pkg].iFlags & pkgDepCache::ReInstall) != pkgDepCache::ReInstall) { _error->Error("Internal Error, trying to manipulate a kept package"); return Failed;