]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/deblistparser.cc
criss-cross merge with my sid branch
[apt.git] / apt-pkg / deb / deblistparser.cc
index 3726a6a042649d3a43d543bf907735765ec45b73..84eab44a7f16b8201b09264944367cfea6659d8d 100644 (file)
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/crc-16.h>
 #include <apt-pkg/md5.h>
+#include <apt-pkg/macros.h>
 
 #include <ctype.h>
-
-#include <system.h>
                                                                        /*}}}*/
 
 static debListParser::WordList PrioList[] = {{"important",pkgCache::State::Important},
@@ -148,6 +147,25 @@ bool debListParser::NewVersion(pkgCache::VerIterator Ver)
         Ver->Priority = pkgCache::State::Extra;
    }
 
+   if (Ver->MultiArch == pkgCache::Version::All)
+   {
+      /* We maintain a "pseudo" arch=all package for architecture all versions
+        on which these versions can depend on. This pseudo package is many used
+        for downloading/installing: The other pseudo-packages will degenerate
+        to a NOP in the download/install step - this package will ensure that
+        it is downloaded only one time and installed only one time -- even if
+        the architecture bound versions coming in and out on regular basis. */
+      bool const static multiArch = APT::Configuration::getArchitectures().size() > 1;
+      if (strcmp(Ver.Arch(true),"all") == 0)
+        return true;
+      else if (multiArch == true)
+      {
+        // our pseudo packages have no size to not confuse the fetcher
+        Ver->Size = 0;
+        Ver->InstalledSize = 0;
+      }
+   }
+
    if (ParseDepends(Ver,"Depends",pkgCache::Dep::Depends) == false)
       return false;
    if (ParseDepends(Ver,"Pre-Depends",pkgCache::Dep::PreDepends) == false)
@@ -593,7 +611,7 @@ bool debListParser::ParseDepends(pkgCache::VerIterator Ver,
       return true;
    
    string Package;
-   string const pkgArch = Ver.Arch();
+   string const pkgArch = Ver.Arch(true);
    string Version;
    unsigned int Op;
 
@@ -622,7 +640,7 @@ bool debListParser::ParseProvides(pkgCache::VerIterator Ver)
    {
       string Package;
       string Version;
-      string const Arch = Ver.Arch();
+      string const Arch = Ver.Arch(true);
       unsigned int Op;
 
       while (1)