summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/depcache.cc5
-rw-r--r--apt-pkg/depcache.h2
-rw-r--r--debian/changelog3
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 <michael.vogt@ubuntu.com> Wed, 20 Sep 2006 14:14:24 +0200
apt (0.6.45ubuntu10) edgy; urgency=low