Просмотр исходного кода

In SingleArch environments we don't need the arch "all" pseudo package
for handling arch:all packages, so we create only one package and stop
calling it a pseudo package.

David Kalnischkies лет назад: 16
Родитель
Сommit
42d71ab5fe
4 измененных файлов с 13 добавлено и 4 удалено
  1. 1 1
      apt-pkg/deb/deblistparser.cc
  2. 7 2
      apt-pkg/pkgcache.cc
  3. 2 1
      apt-pkg/pkgcachegen.cc
  4. 3 0
      cmdline/apt-get.cc

+ 1 - 1
apt-pkg/deb/deblistparser.cc

@@ -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;

+ 7 - 2
apt-pkg/pkgcache.cc

@@ -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	/*{{{*/

+ 2 - 1
apt-pkg/pkgcachegen.cc

@@ -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());
 

+ 3 - 0
cmdline/apt-get.cc

@@ -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