if (pp.Pkg.end() == true)
return os << "invalid package";
- std::string current = (pp.Pkg.CurVersion() == 0 ? "none" : pp.Pkg.CurVersion());
- std::string candidate = (*pp.DepCache)[pp.Pkg].CandVersion;
- std::string newest = (pp.Pkg.VersionList().end() ? "none" : pp.Pkg.VersionList().VerStr());
-
- os << pp.Pkg.Name() << " [ " << pp.Pkg.Arch() << " ] < " << current;
- if (current != candidate)
- os << " -> " << candidate;
- if ( newest != "none" && candidate != newest)
- os << " | " << newest;
- if (pp.Pkg->VersionList == 0)
- os << " > ( none )";
- else
- os << " > ( " << (pp.Pkg.VersionList().Section()==0?"unknown":pp.Pkg.VersionList().Section()) << " )";
+ auto state = (*pp.DepCache)[pp.Pkg];
+ std::string const current = (pp.Pkg.CurVersion() == 0 ? "none" : pp.Pkg.CurVersion());
+ std::string candidate = state.CandVersion;
+ if (candidate.empty())
+ candidate = "none";
+ std::string install = "none";
+ if (state.InstallVer != nullptr)
+ install = state.InstVerIter(*pp.DepCache).VerStr();
+
+ os << pp.Pkg.FullName(false) << " < " << current;
+ if (current != install && install != "none")
+ os << " -> " << install;
+ if (install != candidate && current != candidate)
+ os << " | " << candidate;
+ os << " @";
+ switch (pp.Pkg->SelectedState)
+ {
+ case pkgCache::State::Unknown: os << 'u'; break;
+ case pkgCache::State::Install: os << 'i'; break;
+ case pkgCache::State::Hold: os << 'h'; break;
+ case pkgCache::State::DeInstall: os << 'r'; break;
+ case pkgCache::State::Purge: os << 'p'; break;
+ default: os << 'X';
+ }
+ switch (pp.Pkg->InstState)
+ {
+ case pkgCache::State::Ok: break;
+ case pkgCache::State::ReInstReq: os << 'R'; break;
+ case pkgCache::State::HoldInst: os << 'H'; break;
+ case pkgCache::State::HoldReInstReq: os << "HR"; break;
+ default: os << 'X';
+ }
+ switch (pp.Pkg->CurrentState)
+ {
+ case pkgCache::State::NotInstalled: os << 'n'; break;
+ case pkgCache::State::ConfigFiles: os << 'c'; break;
+ case pkgCache::State::HalfInstalled: os << 'H'; break;
+ case pkgCache::State::UnPacked: os << 'U'; break;
+ case pkgCache::State::HalfConfigured: os << 'F'; break;
+ case pkgCache::State::TriggersAwaited: os << 'W'; break;
+ case pkgCache::State::TriggersPending: os << 'T'; break;
+ case pkgCache::State::Installed: os << 'i'; break;
+ default: os << 'X';
+ }
+ os << ' ';
+ if (state.Protect())
+ os << "p";
+ if (state.ReInstall())
+ os << "r";
+ if (state.Upgradable())
+ os << "u";
+ if (state.Marked)
+ os << "m";
+ if (state.Garbage)
+ os << "g";
+ if (state.NewInstall())
+ os << "N";
+ else if (state.Upgrade())
+ os << "U";
+ else if (state.Downgrade())
+ os << "D";
+ else if (state.Install())
+ os << "I";
+ else if (state.Purge())
+ os << "P";
+ else if (state.Delete())
+ os << "R";
+ else if (state.Held())
+ os << "H";
+ else if (state.Keep())
+ os << "K";
+ if (state.NowBroken())
+ os << " Nb";
+ else if (state.NowPolicyBroken())
+ os << " NPb";
+ if (state.InstBroken())
+ os << " Ib";
+ else if (state.InstPolicyBroken())
+ os << " IPb";
+ os << " >";
return os;
}
/*}}}*/
*/
struct PrettyPkg
{
- pkgDepCache const * const DepCache;
+ pkgDepCache * const DepCache;
pkgCache::PkgIterator const Pkg;
- PrettyPkg(pkgDepCache const * const depcache, pkgCache::PkgIterator const &pkg) APT_NONNULL(2) : DepCache(depcache), Pkg(pkg) {}
+ PrettyPkg(pkgDepCache * const depcache, pkgCache::PkgIterator const &pkg) APT_NONNULL(2) : DepCache(depcache), Pkg(pkg) {}
};
/** helper to format DepIterator for easier printing in debug messages.
*
*/
struct PrettyDep
{
- pkgDepCache const * const DepCache;
+ pkgDepCache * const DepCache;
pkgCache::DepIterator const Dep;
- PrettyDep(pkgDepCache const * const depcache, pkgCache::DepIterator const &dep) APT_NONNULL(2) : DepCache(depcache), Dep(dep) {}
+ PrettyDep(pkgDepCache * const depcache, pkgCache::DepIterator const &dep) APT_NONNULL(2) : DepCache(depcache), Dep(dep) {}
};
}
# prevent it, but to late - its better to fail earlier
testsuccessequal "Reading package lists...
Building dependency tree...
- MarkInstall coolstuff [ i386 ] < none -> 1.0 > ( other ) FU=1
- Ignore MarkInstall of extracoolstuff [ i386 ] < none -> 1.0 > ( other ) as its mode (Keep) is protected
+ MarkInstall coolstuff:i386 < none -> 1.0 @un puN IPb > FU=1
+ Ignore MarkInstall of extracoolstuff:i386 < none | 1.0 @hn puH > as its mode (Keep) is protected
Package 'extracoolstuff' is not installed, so not removed
Recommended packages:
extracoolstuff
CONFLICTING='Reading package lists...
Building dependency tree...
- MarkInstall dummy-archive [ i386 ] < none -> 0.invalid.0 > ( admin ) FU=1
- MarkInstall libavcodec52 [ i386 ] < none -> 4:0.5.2-6 > ( libs ) FU=0
- MarkInstall libvtk5-dev [ i386 ] < none -> 5.4.2-8 > ( libdevel ) FU=0
- MarkInstall libvtk5.4 [ i386 ] < none -> 5.4.2-8 > ( libs ) FU=0
- MarkKeep libvtk5-dev [ i386 ] < none -> 5.4.2-8 > ( libdevel ) FU=0
- MarkKeep libvtk5-dev [ i386 ] < none -> 5.4.2-8 > ( libdevel ) FU=0
- MarkDelete libvtk5.4 [ i386 ] < none -> 5.4.2-8 > ( libs ) FU=0
+ MarkInstall dummy-archive:i386 < none -> 0.invalid.0 @un puN Ib > FU=1
+ MarkInstall libavcodec52:i386 < none -> 4:0.5.2-6 @un uN > FU=0
+ MarkInstall libvtk5-dev:i386 < none -> 5.4.2-8 @un uN Ib > FU=0
+ MarkInstall libvtk5.4:i386 < none -> 5.4.2-8 @un uN > FU=0
+ MarkKeep libvtk5-dev:i386 < none -> 5.4.2-8 @un uN > FU=0
+ MarkKeep libvtk5-dev:i386 < none -> 5.4.2-8 @un uN > FU=0
+ MarkDelete libvtk5.4:i386 < none -> 5.4.2-8 @un ugN > FU=0
The following additional packages will be installed:
libavcodec52 libopenal-dev
The following NEW packages will be installed:
testsuccessequal 'Reading package lists...
Building dependency tree...
- MarkDelete libdb4.8 [ i386 ] < 1.0 > ( other ) FU=1
- MarkDelete exim4-daemon-light [ i386 ] < 1.0 > ( other ) FU=0
- MarkInstall exim4-daemon-heavy [ i386 ] < none -> 1.0 > ( other ) FU=0
- Ignore MarkInstall of libdb4.8 [ i386 ] < 1.0 > ( other ) as its mode (Delete) is protected
- MarkDelete exim4-daemon-heavy [ i386 ] < none -> 1.0 > ( other ) FU=0
- MarkDelete exim4 [ i386 ] < 1.0 > ( other ) FU=0
+ MarkDelete libdb4.8:i386 < 1.0 @ii pmK > FU=1
+ MarkDelete exim4-daemon-light:i386 < 1.0 @ii mK Ib > FU=0
+ MarkInstall exim4-daemon-heavy:i386 < none -> 1.0 @un uN Ib > FU=0
+ Ignore MarkInstall of libdb4.8:i386 < 1.0 @ii pmR > as its mode (Delete) is protected
+ MarkDelete exim4-daemon-heavy:i386 < none -> 1.0 @un uN Ib > FU=0
+ MarkDelete exim4:i386 < 1.0 @ii mK Ib > FU=0
The following packages will be REMOVED:
exim4 exim4-daemon-light libdb4.8
- MarkDelete exim4 [ i386 ] < 1.0 > ( other ) FU=1
+ MarkDelete exim4:i386 < 1.0 @ii K > FU=1
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
Remv exim4 [1.0]
- MarkDelete exim4-daemon-light [ i386 ] < 1.0 > ( other ) FU=1
+ MarkDelete exim4-daemon-light:i386 < 1.0 @ii K > FU=1
Remv exim4-daemon-light [1.0]
- MarkDelete libdb4.8 [ i386 ] < 1.0 > ( other ) FU=1
+ MarkDelete libdb4.8:i386 < 1.0 @ii K > FU=1
Remv libdb4.8 [1.0]' aptget remove libdb4.8 -s -o Debug::pkgDepCache::Marker=1