]> 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 9ae1065a4047f72bb57b213b833a7b482b6e9b94..651fa2a8143e637c7356cd60ed132a4374d3f2d8 100644 (file)
@@ -461,7 +461,7 @@ const char *debListParser::ConvertRelation(const char *I,unsigned int &Op)
  *
  * The complete architecture, consisting of <kernel>-<cpu>.
  */
-static string CompleteArch(std::stringarch) {
+static string CompleteArch(std::string const &arch) {
     if (arch == "armel")              return "linux-arm";
     if (arch == "armhf")              return "linux-arm";
     if (arch == "lpia")               return "linux-i386";
@@ -500,9 +500,13 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
    Package.assign(Start,I - Start);
 
    // We don't want to confuse library users which can't handle MultiArch
+   string const arch = _config->Find("APT::Architecture");
    if (StripMultiArch == true) {
       size_t const found = Package.rfind(':');
-      if (found != string::npos)
+      if (found != string::npos &&
+         (strcmp(Package.c_str() + found, ":any") == 0 ||
+          strcmp(Package.c_str() + found, ":native") == 0 ||
+          strcmp(Package.c_str() + found + 1, arch.c_str()) == 0))
         Package = Package.substr(0,found);
    }
 
@@ -543,7 +547,6 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
 
    if (ParseArchFlags == true)
    {
-      string arch = _config->Find("APT::Architecture");
       string completeArch = CompleteArch(arch);
 
       // Parse an architecture