X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/529bf9b00dfd3c0472d77e9515007e52a3557bc4..a6f8c07f83e4e5a8155c04feab543dc0c82ed495:/apt-pkg/depcache.cc diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 8281949f9..f38f956e4 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -791,7 +792,7 @@ bool pkgDepCache::MarkKeep(PkgIterator const &Pkg, bool Soft, bool FromUser, #endif if (DebugMarker == true) - std::clog << OutputInDepth(Depth) << "MarkKeep " << Pkg << " FU=" << FromUser << std::endl; + std::clog << OutputInDepth(Depth) << "MarkKeep " << APT::PrettyPkg(this, Pkg) << " FU=" << FromUser << std::endl; RemoveSizes(Pkg); RemoveStates(Pkg); @@ -871,7 +872,7 @@ bool pkgDepCache::MarkDelete(PkgIterator const &Pkg, bool rPurge, } if (DebugMarker == true) - std::clog << OutputInDepth(Depth) << (rPurge ? "MarkPurge " : "MarkDelete ") << Pkg << " FU=" << FromUser << std::endl; + std::clog << OutputInDepth(Depth) << (rPurge ? "MarkPurge " : "MarkDelete ") << APT::PrettyPkg(this, Pkg) << " FU=" << FromUser << std::endl; RemoveSizes(Pkg); RemoveStates(Pkg); @@ -907,7 +908,7 @@ bool pkgDepCache::IsDeleteOkProtectInstallRequests(PkgIterator const &Pkg, if (P.InstallVer != 0 && P.Status == 2 && (P.Flags & Flag::Auto) != Flag::Auto) { if (DebugMarker == true) - std::clog << OutputInDepth(Depth) << "Manual install request prevents MarkDelete of " << Pkg << std::endl; + std::clog << OutputInDepth(Depth) << "Manual install request prevents MarkDelete of " << APT::PrettyPkg(this, Pkg) << std::endl; return false; } } @@ -957,7 +958,7 @@ bool pkgDepCache::IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg, { if (unlikely(DebugMarker == true)) std::clog << OutputInDepth(Depth) << "Ignore Mark" << PrintMode(mode) - << " of " << Pkg << " as its mode (" << PrintMode(P.Mode) + << " of " << APT::PrettyPkg(this, Pkg) << " as its mode (" << PrintMode(P.Mode) << ") is protected" << std::endl; return false; } @@ -967,7 +968,7 @@ bool pkgDepCache::IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg, { if (unlikely(DebugMarker == true)) std::clog << OutputInDepth(Depth) << "Hold prevents Mark" << PrintMode(mode) - << " of " << Pkg << std::endl; + << " of " << APT::PrettyPkg(this, Pkg) << std::endl; return false; } @@ -1127,7 +1128,7 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, return true; if (DebugMarker == true) - std::clog << OutputInDepth(Depth) << "MarkInstall " << Pkg << " FU=" << FromUser << std::endl; + std::clog << OutputInDepth(Depth) << "MarkInstall " << APT::PrettyPkg(this, Pkg) << " FU=" << FromUser << std::endl; bool MoveAutoBitToDependencies = false; VerIterator const PV = P.InstVerIter(*this); @@ -1360,7 +1361,7 @@ bool pkgDepCache::IsInstallOkMultiArchSameVersionSynced(PkgIterator const &Pkg, // not having a candidate or being in sync // (simple string-compare as stuff like '1' == '0:1-0' can't happen here) VerIterator CV = PkgState[P->ID].CandidateVerIter(*this); - if (CV.end() == true || strcmp(Pkg.CandVersion(), CV.VerStr()) == 0) + if (CV.end() == true || strcmp(CandVer.VerStr(), CV.VerStr()) == 0) continue; // packages losing M-A:same can be out-of-sync @@ -1373,9 +1374,9 @@ bool pkgDepCache::IsInstallOkMultiArchSameVersionSynced(PkgIterator const &Pkg, PkgState[Pkg->ID].iFlags |= AutoKept; if (unlikely(DebugMarker == true)) - std::clog << OutputInDepth(Depth) << "Ignore MarkInstall of " << Pkg - << " as it is not in sync with its M-A:same sibling " << P - << " (" << Pkg.CandVersion() << " != " << CV.VerStr() << ")" << std::endl; + std::clog << OutputInDepth(Depth) << "Ignore MarkInstall of " << APT::PrettyPkg(this, Pkg) + << " as it is not in sync with its M-A:same sibling " << APT::PrettyPkg(this, P) + << " (" << CandVer.VerStr() << " != " << CV.VerStr() << ")" << std::endl; return false; } @@ -1416,12 +1417,20 @@ bool pkgDepCache::IsInstallOkDependenciesSatisfiableByCandidates(PkgIterator con if (Ors == 1 && (DepState[Start->ID] &DepCVer) != DepCVer) { if (DebugAutoInstall == true) - std::clog << OutputInDepth(Depth) << Start << " can't be satisfied!" << std::endl; + std::clog << OutputInDepth(Depth) << APT::PrettyDep(this, Start) << " can't be satisfied!" << std::endl; // the dependency is critical, but can't be installed, so discard the candidate // as the problemresolver will trip over it otherwise trying to install it (#735967) if (Pkg->CurrentVer != 0 && (PkgState[Pkg->ID].iFlags & Protected) != Protected) + { SetCandidateVersion(Pkg.CurrentVer()); + StateCache &State = PkgState[Pkg->ID]; + if (State.Mode != ModeDelete) + { + State.Mode = ModeKeep; + State.Update(Pkg, *this); + } + } return false; } } @@ -1695,11 +1704,7 @@ void pkgDepCache::StateCache::Update(PkgIterator Pkg,pkgCache &Cache) CurVersion = ""; if (Pkg->CurrentVer != 0) CurVersion = Pkg.CurrentVer().VerStr(); - - // Strip off the epochs for display - CurVersion = StripEpoch(CurVersion); - CandVersion = StripEpoch(CandVersion); - + // Figure out if its up or down or equal Status = Ver.CompareVer(Pkg.CurrentVer()); if (Pkg->CurrentVer == 0 || Pkg->VersionList == 0 || CandidateVer == 0)