Explorar el Código

* apt-pkg/deb/debmetaindex.cc:
- do not query each architecture for flat file archives

David Kalnischkies hace 16 años
padre
commit
dd13742ef1

+ 4 - 4
apt-pkg/deb/debindexfile.cc

@@ -184,8 +184,8 @@ string debPackagesIndex::ArchiveInfo(pkgCache::VerIterator Ver) const
    Res += " ";
    Res += Ver.ParentPkg().Name();
    Res += " ";
-   Res += Ver.Arch();
-   Res += " ";
+   if (Dist[Dist.size() - 1] != '/')
+      Res.append(Ver.Arch()).append(" ");
    Res += Ver.VerStr();
    return Res;
 }
@@ -219,8 +219,8 @@ string debPackagesIndex::Info(const char *Type) const
    else
       Info += Dist + '/' + Section;   
    Info += " ";
-   Info += Architecture;
-   Info += " ";
+   if (Dist[Dist.size() - 1] != '/')
+      Info += Architecture + " ";
    Info += Type;
    return Info;
 }

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

@@ -757,7 +757,7 @@ bool debListParser::Step()
       if (Architecture.empty() == true)
 	 return true;
 
-      if (Arch.empty() == true || MultiArchEnabled == false)
+      if (Arch.empty() == true || Arch == "any" || MultiArchEnabled == false)
       {
 	 if (APT::Configuration::checkArchitecture(Architecture) == true)
 	    return true;

+ 12 - 2
apt-pkg/deb/debmetaindex.cc

@@ -332,7 +332,12 @@ class debSLTypeDebian : public pkgSourceList::Type
 	    if (IsSrc == true)
 	       Deb->PushSectionEntry("source", new debReleaseIndex::debSectionEntry(Section, IsSrc));
 	    else
-	       Deb->PushSectionEntry(Archs, new debReleaseIndex::debSectionEntry(Section, IsSrc));
+	    {
+	       if (Dist[Dist.size() - 1] == '/')
+		  Deb->PushSectionEntry("any", new debReleaseIndex::debSectionEntry(Section, IsSrc));
+	       else
+		  Deb->PushSectionEntry(Archs, new debReleaseIndex::debSectionEntry(Section, IsSrc));
+	    }
 	    return true;
 	 }
       }
@@ -342,7 +347,12 @@ class debSLTypeDebian : public pkgSourceList::Type
       if (IsSrc == true)
 	 Deb->PushSectionEntry ("source", new debReleaseIndex::debSectionEntry(Section, IsSrc));
       else
-	 Deb->PushSectionEntry (Archs, new debReleaseIndex::debSectionEntry(Section, IsSrc));
+      {
+	 if (Dist[Dist.size() - 1] == '/')
+	    Deb->PushSectionEntry ("any", new debReleaseIndex::debSectionEntry(Section, IsSrc));
+	 else
+	    Deb->PushSectionEntry (Archs, new debReleaseIndex::debSectionEntry(Section, IsSrc));
+      }
       List.push_back(Deb);
       return true;
    }

+ 2 - 0
apt-pkg/pkgcachegen.cc

@@ -1094,6 +1094,7 @@ static bool BuildCache(pkgCacheGenerator &Gen,
    return true;
 }
 									/*}}}*/
+// CacheGenerator::CreateDynamicMMap - load an mmap with configuration options	/*{{{*/
 DynamicMMap* pkgCacheGenerator::CreateDynamicMMap(FileFd *CacheF, unsigned long Flags) {
    unsigned long const MapStart = _config->FindI("APT::Cache-Start", 24*1024*1024);
    unsigned long const MapGrow = _config->FindI("APT::Cache-Grow", 1*1024*1024);
@@ -1106,6 +1107,7 @@ DynamicMMap* pkgCacheGenerator::CreateDynamicMMap(FileFd *CacheF, unsigned long
    else
       return new DynamicMMap(Flags, MapStart, MapGrow, MapLimit);
 }
+									/*}}}*/
 // CacheGenerator::MakeStatusCache - Construct the status cache		/*{{{*/
 // ---------------------------------------------------------------------
 /* This makes sure that the status cache (the cache that has all 

+ 2 - 0
debian/changelog

@@ -4,6 +4,8 @@ apt (0.7.26~exp10) UNRELEASED; urgency=low
   * apt-pkg/contrib/error.{cc,h}:
     - remove constness of va_list parameter to fix build on amd64 and co
       Thanks Eric Valette! (Closes: #588610)
+  * apt-pkg/deb/debmetaindex.cc:
+    - do not query each architecture for flat file archives
 
   [ Martin Pitt ]
   * debian/rules: