]> git.saurik.com Git - apt.git/commitdiff
generate "negative" dependencies against all architectures of a package
authorDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 18 Mar 2010 17:07:51 +0000 (18:07 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 18 Mar 2010 17:07:51 +0000 (18:07 +0100)
Negative means here Conflicts, Replaces and Breaks - this adds again
a whole lot of dependencies.

apt-pkg/deb/deblistparser.cc

index 84eab44a7f16b8201b09264944367cfea6659d8d..5c9cf6d4bfe79c27ebd5c4061f3008360c4a453b 100644 (file)
@@ -609,7 +609,10 @@ bool debListParser::ParseDepends(pkgCache::VerIterator Ver,
    const char *Stop;
    if (Section.Find(Tag,Start,Stop) == false)
       return true;
-   
+
+   static std::vector<std::string> const archs = APT::Configuration::getArchitectures();
+   static bool const multiArch = archs.size() <= 1;
+
    string Package;
    string const pkgArch = Ver.Arch(true);
    string Version;
@@ -620,8 +623,18 @@ bool debListParser::ParseDepends(pkgCache::VerIterator Ver,
       Start = ParseDepends(Start,Stop,Package,Version,Op);
       if (Start == 0)
         return _error->Error("Problem parsing dependency %s",Tag);
-      
-      if (NewDepends(Ver,Package,pkgArch,Version,Op,Type) == false)
+
+      if (multiArch == true &&
+         (Type == pkgCache::Dep::Conflicts ||
+          Type == pkgCache::Dep::DpkgBreaks ||
+          Type == pkgCache::Dep::Replaces))
+      {
+        for (std::vector<std::string>::const_iterator a = archs.begin();
+             a != archs.end(); ++a)
+           if (NewDepends(Ver,Package,*a,Version,Op,Type) == false)
+              return false;
+      }
+      else if (NewDepends(Ver,Package,pkgArch,Version,Op,Type) == false)
         return false;
       if (Start == Stop)
         break;