From 95689ededb9738b0c4ec6ebf1add3b79595cc39a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 20 Sep 2006 14:17:08 +0200 Subject: * apt-pkg/depcache.{cc,h}: - added OnlyInstalled option to writeState() * debian/changelog: - prepared nwe upload --- apt-pkg/depcache.cc | 5 ++++- apt-pkg/depcache.h | 2 +- debian/changelog | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 15d7bac43..b8c996c58 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -179,7 +179,7 @@ bool pkgDepCache::readStateFile(OpProgress *Prog) return true; } -bool pkgDepCache::writeStateFile(OpProgress *prog) +bool pkgDepCache::writeStateFile(OpProgress *prog, bool InstalledOnly) { if(_config->FindB("Debug::pkgAutoRemove",false)) std::clog << "pkgDepCache::writeStateFile()" << std::endl; @@ -241,6 +241,9 @@ bool pkgDepCache::writeStateFile(OpProgress *prog) std::clog << "Skipping already written " << pkg.Name() << std::endl; continue; } + // skip not installed ones if requested + if(InstalledOnly && pkg->CurrentVer == 0) + continue; if(_config->FindB("Debug::pkgAutoRemove",false)) std::clog << "Writing new AutoInstall: " << pkg.Name() << std::endl; diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 5cd5ea354..8f759d345 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -406,7 +406,7 @@ class pkgDepCache : protected pkgCache::Namespace // read persistent states bool readStateFile(OpProgress *prog); - bool writeStateFile(OpProgress *prog); + bool writeStateFile(OpProgress *prog, bool InstalledOnly=false); // Size queries inline double UsrSize() {return iUsrSize;}; diff --git a/debian/changelog b/debian/changelog index f98e02b1a..5b1336231 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,9 @@ apt (0.6.45ubuntu11) edgy; urgency=low * removed "installtask" and change it so that tasknames can be given with "apt-get install taskname^" + * improve the writeStateFile() code - -- + -- Michael Vogt Wed, 20 Sep 2006 14:14:24 +0200 apt (0.6.45ubuntu10) edgy; urgency=low -- cgit v1.2.3