]> git.saurik.com Git - apt.git/commitdiff
merge with debian-experimental-ma to get the public policy back
authorDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 10 Jun 2010 14:37:18 +0000 (16:37 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 10 Jun 2010 14:37:18 +0000 (16:37 +0200)
apt-pkg/cachefile.h
apt-pkg/cacheset.cc
apt-pkg/orderlist.cc
apt-pkg/packagemanager.cc
debian/changelog

index 63bc3de471c833d1215c2b5068d67330de4dc06c..09d3ec2676675c3063f32f5cc016b11eb7d245fe 100644 (file)
 
 #include <apt-pkg/depcache.h>
 #include <apt-pkg/acquire.h>
+#include <apt-pkg/policy.h>
 #include <apt-pkg/sourcelist.h>
 
-class pkgPolicy;
-class pkgSourceList;
 class pkgCacheFile
 {
    protected:
@@ -65,6 +64,11 @@ class pkgCacheFile
    inline pkgPolicy* GetPolicy() { BuildPolicy(); return Policy; };
    inline pkgSourceList* GetSourceList() { BuildSourceList(); return SrcList; };
 
+   inline bool IsPkgCacheBuilt() const { return (Cache != NULL); };
+   inline bool IsDepCacheBuilt() const { return (DCache != NULL); };
+   inline bool IsPolicyBuilt() const { return (Policy != NULL); };
+   inline bool IsSrcListBuilt() const { return (SrcList != NULL); };
+
    pkgCacheFile();
    virtual ~pkgCacheFile();
 };
index 43ade4b4e7eb2cd27f8e5d0210e72c597572d0b7..e91b56997b2fc499edbf115fdd6347b549ae9bd0 100644 (file)
@@ -261,9 +261,14 @@ bool VersionSet::AddSelectedVersion(pkgCacheFile &Cache, VersionSet &verset,
 // getCandidateVer - Returns the candidate version of the given package        /*{{{*/
 pkgCache::VerIterator VersionSet::getCandidateVer(pkgCacheFile &Cache,
                pkgCache::PkgIterator const &Pkg, bool const &AllowError) {
-       if (unlikely(Cache.BuildDepCache() == false))
-               return pkgCache::VerIterator(*Cache);
-       pkgCache::VerIterator Cand = Cache[Pkg].CandidateVerIter(Cache);
+       pkgCache::VerIterator Cand;
+       if (Cache.IsDepCacheBuilt() == true)
+               Cand = Cache[Pkg].CandidateVerIter(Cache);
+       else {
+               if (unlikely(Cache.BuildPolicy() == false))
+                       return pkgCache::VerIterator(*Cache);
+               Cand = Cache.GetPolicy()->GetCandidateVer(Pkg);
+       }
        if (AllowError == false && Cand.end() == true)
                _error->Error(_("Can't select candidate version from package %s as it has no candidate"), Pkg.FullName(true).c_str());
        return Cand;
index 7c950292ace11ed299290451cf33a816e800c048..55f9cb9cce8bf9ed2819ceeda3a8e45446bd3f3e 100644 (file)
@@ -117,7 +117,8 @@ bool pkgOrderList::IsMissing(PkgIterator Pkg)
       return false;
 
    // Skip Packages that need configure only.
-   if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure && 
+   if ((Pkg.State() == pkgCache::PkgIterator::NeedsConfigure ||
+        Pkg.State() == pkgCache::PkgIterator::NeedsNothing) &&
        Cache[Pkg].Keep() == true)
       return false;
 
index eef79cccd381443da9de4a702c4eb555cf9a61ef..49776aac705b505e703e127f3300e1c566134d97 100644 (file)
@@ -602,7 +602,8 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg)
       // configured we don't need to unpack it again…
       PkgIterator const P = Pkg.Group().FindPkg("all");
       if (List->IsFlag(P,pkgOrderList::UnPacked) != true &&
-         List->IsFlag(P,pkgOrderList::Configured) != true) {
+         List->IsFlag(P,pkgOrderList::Configured) != true &&
+         P.State() != pkgCache::PkgIterator::NeedsNothing) {
         if (SmartUnPack(P) == false)
            return false;
       }
index d29705d24d3a2c8bb63adfba0450d5298a052e3f..9367c174342728db6a356d57a01b82709aa97071 100644 (file)
@@ -1,3 +1,15 @@
+apt (0.7.26~exp8) UNRELEASED; urgency=low
+
+  * apt-pkg/cacheset.cc:
+    - get the candidate either from an already built depcache
+      or use the policy which is a bit faster than depcache generation
+  * apt-pkg/orderlist.cc:
+    - untouched packages are never missing
+  * apt-pkg/packagemanager.cc:
+    - packages that are not touched doesn't need to be unpacked
+
+ -- David Kalnischkies <kalnischkies@gmail.com>  Thu, 10 Jun 2010 16:36:58 +0200
+
 apt (0.7.26~exp7) experimental; urgency=low
 
   * apt-pkg/cachefile.h: