summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-09-20 14:17:08 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-09-20 14:17:08 +0200
commit95689ededb9738b0c4ec6ebf1add3b79595cc39a (patch)
treebc012486b38bf7d4029b5b97c776b66d311a1e5c /apt-pkg
parentc64eacb78ffcdcd26602e9598b953f801724968c (diff)
* apt-pkg/depcache.{cc,h}:
- added OnlyInstalled option to writeState() * debian/changelog: - prepared nwe upload
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/depcache.cc5
-rw-r--r--apt-pkg/depcache.h2
2 files changed, 5 insertions, 2 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;};