]> git.saurik.com Git - apt.git/commitdiff
In SingleArch environments we don't need the arch "all" pseudo package
authorDavid Kalnischkies <kalnischkies@gmail.com>
Fri, 12 Feb 2010 16:17:16 +0000 (17:17 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Fri, 12 Feb 2010 16:17:16 +0000 (17:17 +0100)
for handling arch:all packages, so we create only one package and stop
calling it a pseudo package.

apt-pkg/deb/deblistparser.cc
apt-pkg/pkgcache.cc
apt-pkg/pkgcachegen.cc
cmdline/apt-get.cc

index b3d95164abcd1bca295a5eb2f5ea921608def75c..1948aedf30d90fb156850a229397c70bbb93c461 100644 (file)
@@ -158,7 +158,7 @@ bool debListParser::NewVersion(pkgCache::VerIterator Ver)
         the architecture bound versions coming in and out on regular basis. */
       if (strcmp(Ver.Arch(true),"all") == 0)
         return true;
-      else
+      else if (Ver.Pseudo() == true)
       {
         // our pseudo packages have no size to not confuse the fetcher
         Ver->Size = 0;
index 04a2c7234bc11fb1292e70c1399f4784f31f75f1..d4268b31ca63f4fcd70ec61c846b5013e8dd28ab 100644 (file)
@@ -657,8 +657,13 @@ bool pkgCache::VerIterator::Automatic() const
    are a problem everytime we need to download/install something. */
 bool pkgCache::VerIterator::Pseudo() const
 {
-   return (S->MultiArch == pkgCache::Version::All &&
-          strcmp(Arch(true),"all") != 0);
+   if (S->MultiArch == pkgCache::Version::All &&
+          strcmp(Arch(true),"all") != 0)
+   {
+          GrpIterator const Grp = ParentPkg().Group();
+          return (Grp->LastPackage != Grp->FirstPackage);
+   }
+   return false;
 }
                                                                        /*}}}*/
 // VerIterator::NewestFile - Return the newest file version relation   /*{{{*/
index c1b546a0089ed57e9df5b158a8d2428dbf5f5354..6d103c6b631de18881a1647845858b7954aceab5 100644 (file)
@@ -117,7 +117,8 @@ bool pkgCacheGenerator::MergeList(ListParser &List,
       std::vector<string> genArch;
       if (List.ArchitectureAll() == true) {
         genArch = APT::Configuration::getArchitectures();
-        genArch.push_back("all");
+        if (genArch.size() != 1)
+           genArch.push_back("all");
       } else
         genArch.push_back(List.Architecture());
 
index 93065004c98bc7f2f0df7fda377f72a259618282..343226bc3f82954f33485cd0a753e6e4a9cf8f71 100644 (file)
@@ -585,6 +585,9 @@ void Stats(ostream &out,pkgDepCache &Dep)
    unsigned long ReInstall = 0;
    for (pkgCache::PkgIterator I = Dep.PkgBegin(); I.end() == false; I++)
    {
+      if (pkgCache::VerIterator(Dep, Dep[I].CandidateVer).Pseudo() == true)
+        continue;
+
       if (Dep[I].NewInstall() == true)
         Install++;
       else