From 120365cee294d00706928b0327ac755ab3448eca Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 28 Jun 2005 08:41:51 +0000 Subject: * cleanups, documentation updates (don't show any debug output if no Debug::pkgAutomaticRemove was set, don't remove if not APT::Get::AutomaticRemove (--automatic-remove) was set) --- apt-pkg/algorithms.cc | 7 +++++-- apt-pkg/depcache.cc | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index dd16b5dc8..5167d11eb 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -1066,7 +1066,10 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) pkgCache::PkgIterator I = Cache.PkgBegin(); for (;I.end() != true; I++) { if (Cache[I].NewInstall() && !(Flags[I->ID] & PreInstalled)) { - std::cout << "Resolve installed new pkg: " << I.Name() << " (now marking it as auto)" << std::endl; + if(_config->FindI("Debug::pkgAutoRemove",false)) { + std::clog << "Resolve installed new pkg: " << I.Name() + << " (now marking it as auto)" << std::endl; + } Cache[I].Flags |= pkgCache::Flag::Auto; } } @@ -1333,7 +1336,7 @@ bool pkgMarkUsed(pkgDepCache &Cache) if(_config->FindI("Debug::pkgAutoRemove",false) == true) for (pkgCache::PkgIterator Pkg = Cache.PkgBegin(); ! Pkg.end(); ++Pkg) if(!Cache[Pkg].Dirty() && Cache[Pkg].AutomaticRemove > 0) - std::cout << "has auto-remove information: " << Pkg.Name() + std::clog << "has auto-remove information: " << Pkg.Name() << " " << (int)Cache[Pkg].AutomaticRemove << std::endl; diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 54cfcb8bb..e30baa4b2 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -20,6 +20,8 @@ #include #include #include + +#include #include #include /*}}}*/ @@ -162,7 +164,8 @@ bool pkgDepCache::writeStateFile(OpProgress *prog) // check if we have new information if(PkgState[pkg->ID].Flags & pkgCache::Flag::Auto) { - std::cout << "pkg: " << pkg.Name() << " is auto-dep" << std::endl; + if(_config->FindI("Debug::pkgAutoRemove",false)) + std::clog << "pkg: " << pkg.Name() << " is auto-dep" << std::endl; PkgState[pkg->ID].AutomaticRemove = pkgCache::State::RemoveRequired; } @@ -172,7 +175,6 @@ bool pkgDepCache::writeStateFile(OpProgress *prog) << "\nRemove-Reason: " << (int)(PkgState[pkg->ID].AutomaticRemove) << "\n\n"; StateFile.Write(ostr.str().c_str(), ostr.str().size()); - //std::cout << "Writing auto-mark: " << ostr.str() << endl; } } return true; -- cgit v1.2.3