]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/deblistparser.cc
* apt-pkg/deb/deblistparser.cc:
[apt.git] / apt-pkg / deb / deblistparser.cc
index 0551a5f7ca9e1c79f9096271bb94df503daa2062..ddbd0d31a61fc2c1504291c75015f36479096aa3 100644 (file)
@@ -19,6 +19,7 @@
 #include <apt-pkg/md5.h>
 #include <apt-pkg/macros.h>
 
+#include <fnmatch.h>
 #include <ctype.h>
                                                                        /*}}}*/
 
@@ -133,10 +134,9 @@ bool debListParser::NewVersion(pkgCache::VerIterator Ver)
    }
 
    // Archive Size
-   Ver->Size = (unsigned)Section.FindI("Size");
-   
+   Ver->Size = Section.FindULL("Size");
    // Unpacked Size (in K)
-   Ver->InstalledSize = (unsigned)Section.FindI("Installed-Size");
+   Ver->InstalledSize = Section.FindULL("Installed-Size");
    Ver->InstalledSize *= 1024;
 
    // Priority
@@ -573,8 +573,15 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
               I++;
             }
 
-           if (stringcmp(arch,I,End) == 0)
+           if (stringcmp(arch,I,End) == 0) {
               Found = true;
+           } else {
+              std::string wildcard = SubstVar(string(I, End), "any", "*");
+              if (fnmatch(wildcard.c_str(), arch.c_str(), 0) == 0)
+                 Found = true;
+              else if (fnmatch(wildcard.c_str(), ("linux-" + arch).c_str(), 0) == 0)
+                 Found = true;
+           }
            
            if (*End++ == ']') {
               I = End;