]> git.saurik.com Git - apt.git/commitdiff
* apt-pkg/depcache.{cc,h}:
authorMichael Vogt <michael.vogt@ubuntu.com>
Wed, 20 Sep 2006 12:17:08 +0000 (14:17 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Wed, 20 Sep 2006 12:17:08 +0000 (14:17 +0200)
 - added OnlyInstalled option to writeState()
* debian/changelog:
  - prepared nwe upload

apt-pkg/depcache.cc
apt-pkg/depcache.h
debian/changelog

index 15d7bac4397c8c8b3ace996a04673184e8dcbe31..b8c996c58d21d35b59dc95bf952ef43c7ebdd924 100644 (file)
@@ -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;
index 5cd5ea354fa353bf33fb4f7e9738d283f7bb35eb..8f759d345a1f49121267b73fe295d5fe753c64f5 100644 (file)
@@ -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;};
index f98e02b1adfd2c293b61e5cd11deedd1dd8ebb78..5b13362316247ce99c9c368ad23c8142fc2d80fe 100644 (file)
@@ -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