summaryrefslogtreecommitdiff
path: root/apt-pkg/depcache.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-04-28 09:22:55 +0200
committerJulian Andres Klode <jak@debian.org>2016-08-31 13:49:37 +0200
commit90daf43aeb6a911f6511faf5064f5811fd27acb5 (patch)
tree0cba503cc9005ae417c5d932e1632fdca9732e1b /apt-pkg/depcache.cc
parent18048c51c1d8cff71f134dd405421baba292944b (diff)
factor out Pkg/DepIterator prettyprinters into own header
The old prettyprinters have only access to the struct they pretty print, which isn't enough usually as we want to know for a package also a bit of state information like which version is the candidate. We therefore need to pull the DepCache into context and hence use a temporary struct which is printed instead of the iterator itself. (cherry picked from commit 84573326f41dd09b914b8374548e7ee7c93d0439)
Diffstat (limited to 'apt-pkg/depcache.cc')
-rw-r--r--apt-pkg/depcache.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 5af94a58b..01ae66ed2 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -22,6 +22,7 @@
#include <apt-pkg/cacheset.h>
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/prettyprinters.h>
#include <apt-pkg/cachefile.h>
#include <apt-pkg/macros.h>
@@ -796,7 +797,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);
@@ -876,7 +877,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);
@@ -912,7 +913,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;
}
}
@@ -962,7 +963,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;
}
@@ -972,7 +973,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;
}
@@ -1132,7 +1133,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);
@@ -1378,8 +1379,8 @@ 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
+ 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;
}
@@ -1421,7 +1422,7 @@ 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)