summaryrefslogtreecommitdiff
path: root/apt-pkg/algorithms.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-04-28 09:22:55 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-04-28 10:08:32 +0200
commit84573326f41dd09b914b8374548e7ee7c93d0439 (patch)
tree3fc7af54e2322c0803495e3a79f69ab138c8f172 /apt-pkg/algorithms.cc
parent29636cc759c6fbb92c6c462c90611eefb67cbbd4 (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.
Diffstat (limited to 'apt-pkg/algorithms.cc')
-rw-r--r--apt-pkg/algorithms.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc
index ee4787b38..fbc809ed0 100644
--- a/apt-pkg/algorithms.cc
+++ b/apt-pkg/algorithms.cc
@@ -24,6 +24,7 @@
#include <apt-pkg/packagemanager.h>
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/prettyprinters.h>
#include <string.h>
#include <string>
@@ -710,7 +711,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
if (Scores[(*K)->ID] != 0)
{
pkgCache::PkgIterator Pkg(Cache,*K);
- clog << Scores[(*K)->ID] << ' ' << Pkg << std::endl;
+ clog << Scores[(*K)->ID] << ' ' << APT::PrettyPkg(&Cache, Pkg) << std::endl;
}
}
@@ -765,7 +766,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
continue;
if (Debug == true)
- clog << "Investigating (" << Counter << ") " << I << endl;
+ clog << "Investigating (" << Counter << ") " << APT::PrettyPkg(&Cache, I) << endl;
// Isolate the problem dependency
bool InOr = false;
@@ -835,7 +836,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
}
if (Debug == true)
- clog << "Broken " << Start << endl;
+ clog << "Broken " << APT::PrettyDep(&Cache, Start) << endl;
/* Look across the version list. If there are no possible
targets then we keep the package and bail. This is necessary
@@ -942,7 +943,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
is removed by the resolver because of a conflict or alike but it is
dangerous as it could trigger new breaks/conflicts… */
if (Debug == true)
- clog << " Try Installing " << Start.TargetPkg() << " before changing " << I.FullName(false) << std::endl;
+ clog << " Try Installing " << APT::PrettyPkg(&Cache, Start.TargetPkg()) << " before changing " << I.FullName(false) << std::endl;
unsigned long const OldBroken = Cache.BrokenCount();
Cache.MarkInstall(Start.TargetPkg(), true, 1, false);
// FIXME: we should undo the complete MarkInstall process here
@@ -1108,7 +1109,7 @@ bool pkgProblemResolver::InstOrNewPolicyBroken(pkgCache::PkgIterator I)
if (Cache[I].InstBroken() == true)
{
if (Debug == true)
- std::clog << " Dependencies are not satisfied for " << I << std::endl;
+ std::clog << " Dependencies are not satisfied for " << APT::PrettyPkg(&Cache, I) << std::endl;
return true;
}
@@ -1117,7 +1118,7 @@ bool pkgProblemResolver::InstOrNewPolicyBroken(pkgCache::PkgIterator I)
Cache[I].InstPolicyBroken() == true)
{
if (Debug == true)
- std::clog << " Policy breaks with upgrade of " << I << std::endl;
+ std::clog << " Policy breaks with upgrade of " << APT::PrettyPkg(&Cache, I) << std::endl;
return true;
}
@@ -1169,7 +1170,7 @@ bool pkgProblemResolver::ResolveByKeepInternal()
if (Scores[(*K)->ID] != 0)
{
pkgCache::PkgIterator Pkg(Cache,*K);
- clog << Scores[(*K)->ID] << ' ' << Pkg << std::endl;
+ clog << Scores[(*K)->ID] << ' ' << APT::PrettyPkg(&Cache, Pkg) << std::endl;
}
}
@@ -1224,7 +1225,7 @@ bool pkgProblemResolver::ResolveByKeepInternal()
while (true)
{
if (Debug == true)
- clog << "Package " << I.FullName(false) << " " << Start << endl;
+ clog << "Package " << I.FullName(false) << " " << APT::PrettyDep(&Cache, Start) << endl;
// Look at all the possible provides on this package
std::unique_ptr<pkgCache::Version *[]> VList(Start.AllTargets());