From f0c2263dd702d646722b749f7b7d278d15c18c55 Mon Sep 17 00:00:00 2001 From: Filipe Brandenburger Date: Wed, 7 Mar 2018 14:15:33 -0800 Subject: Increase debug verbosity in `apt-get autoremove` When running with Debug::pkgAutoRemove=yes, explain why certain packages are being marked, either because they're marked essential/important or because they match the blacklist from APT::NeverAutoRemove. This should help troubleshoot cases where autoremove is not proposing removal of packages expected to be up for removal. Tested manually with `apt-get autoremove -o Debug::pkgAutoRemove=yes`. --- apt-pkg/depcache.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'apt-pkg/depcache.h') diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 4536f3b52..724bf566e 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -88,11 +88,15 @@ class pkgDepCache : protected pkgCache::Namespace * * \param follow_suggests If \b true, suggestions of the package * will be recursively marked. + * + * \param reason The reason why the package is being marked. + * (Used in logging when Debug::pkgAutoRemove is set.) */ APT_HIDDEN void MarkPackage(const pkgCache::PkgIterator &pkg, const pkgCache::VerIterator &ver, bool const &follow_recommends, - bool const &follow_suggests); + bool const &follow_suggests, + const char *reason); /** \brief Update the Marked field of all packages. * -- cgit v1.2.3