]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/debmetaindex.cc
* Applied patch from Aurelien Jarno <aurel32@debian.org> to avoid CPU
[apt.git] / apt-pkg / deb / debmetaindex.cc
index 9c7828d6ae28eb86803cbab95aaa3f16bd73e63e..9ac659f78730d9cf50acd0badfe945a9e753fe75 100644 (file)
@@ -1,9 +1,5 @@
 // ijones, walters
 
-#ifdef __GNUG__
-#pragma implementation "apt-pkg/debmetaindex.h"
-#endif
-
 #include <apt-pkg/debmetaindex.h>
 #include <apt-pkg/debindexfile.h>
 #include <apt-pkg/strutl.h>
@@ -148,7 +144,7 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool GetAll) const
       vector <struct IndexTarget *> *targets = ComputeIndexTargets();
       for (vector <struct IndexTarget*>::const_iterator Target = targets->begin(); Target != targets->end(); Target++) {
         new pkgAcqIndex(Owner, (*Target)->URI, (*Target)->Description,
-                        (*Target)->ShortDesc, "");
+                        (*Target)->ShortDesc, HashString());
       }
    }
    new pkgAcqMetaSig(Owner, MetaIndexURI("Release.gpg"),
@@ -161,6 +157,8 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool GetAll) const
    for (vector<const debSectionEntry *>::const_iterator I = SectionEntries.begin(); 
        I != SectionEntries.end(); I++) {
 
+      if((*I)->IsSrc)
+        continue;
       debTranslationsIndex i = debTranslationsIndex(URI,Dist,(*I)->Section);
       i.GetIndexes(Owner);
    }
@@ -173,6 +171,10 @@ bool debReleaseIndex::IsTrusted() const
    string VerifiedSigFile = _config->FindDir("Dir::State::lists") +
       URItoFileName(MetaIndexURI("Release")) + ".gpg";
    
+   if(_config->FindB("APT::Authentication::TrustCDROM", false))
+      if(URI.substr(0,strlen("cdrom:")) == "cdrom:")
+        return true;
+   
    if (FileExists(VerifiedSigFile))
       return true;
    return false;
@@ -189,8 +191,10 @@ vector <pkgIndexFile *> *debReleaseIndex::GetIndexFiles()
       if ((*I)->IsSrc)
          Indexes->push_back(new debSourcesIndex (URI, Dist, (*I)->Section, IsTrusted()));
       else 
+      {
          Indexes->push_back(new debPackagesIndex (URI, Dist, (*I)->Section, IsTrusted()));
-      Indexes->push_back(new debTranslationsIndex(URI,Dist,(*I)->Section));
+        Indexes->push_back(new debTranslationsIndex(URI, Dist, (*I)->Section));
+      }
    }
 
    return Indexes;
@@ -220,7 +224,7 @@ class debSLTypeDebian : public pkgSourceList::Type
         // This check insures that there will be only one Release file
         // queued for all the Packages files and Sources files it
         // corresponds to.
-        if ((*I)->GetType() == "deb")
+               if (strcmp((*I)->GetType(), "deb") == 0)
         {
            debReleaseIndex *Deb = (debReleaseIndex *) (*I);
            // This check insures that there will be only one Release file