diff options
author | David Kalnischkies <david@kalnischkies.de> | 2016-04-28 09:22:55 +0200 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2016-08-31 13:49:37 +0200 |
commit | 90daf43aeb6a911f6511faf5064f5811fd27acb5 (patch) | |
tree | 0cba503cc9005ae417c5d932e1632fdca9732e1b /apt-pkg/pkgcache.cc | |
parent | 18048c51c1d8cff71f134dd405421baba292944b (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/pkgcache.cc')
-rw-r--r-- | apt-pkg/pkgcache.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 899061e73..27a0ba035 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -553,7 +553,9 @@ operator<<(std::ostream& out, pkgCache::PkgIterator Pkg) return out << "invalid package"; string current = string(Pkg.CurVersion() == 0 ? "none" : Pkg.CurVersion()); +APT_IGNORE_DEPRECATED_PUSH string candidate = string(Pkg.CandVersion() == 0 ? "none" : Pkg.CandVersion()); +APT_IGNORE_DEPRECATED_POP string newest = string(Pkg.VersionList().end() ? "none" : Pkg.VersionList().VerStr()); out << Pkg.Name() << " [ " << Pkg.Arch() << " ] < " << current; @@ -815,10 +817,12 @@ std::ostream& operator<<(std::ostream& out, pkgCache::DepIterator D) out << (P.end() ? "invalid pkg" : P.FullName(false)) << " " << D.DepType() << " on "; +APT_IGNORE_DEPRECATED_PUSH if (T.end() == true) out << "invalid pkg"; else out << T; +APT_IGNORE_DEPRECATED_POP if (D->Version != 0) out << " (" << D.CompType() << " " << D.TargetVer() << ")"; |