ソースを参照

generate "negative" dependencies against all architectures of a package

Negative means here Conflicts, Replaces and Breaks - this adds again
a whole lot of dependencies.
David Kalnischkies 16 年 前
コミット
306eacf617
共有1 個のファイルを変更した16 個の追加3 個の削除を含む
  1. 16 3
      apt-pkg/deb/deblistparser.cc

+ 16 - 3
apt-pkg/deb/deblistparser.cc

@@ -609,7 +609,10 @@ bool debListParser::ParseDepends(pkgCache::VerIterator Ver,
    const char *Stop;
    const char *Stop;
    if (Section.Find(Tag,Start,Stop) == false)
    if (Section.Find(Tag,Start,Stop) == false)
       return true;
       return true;
-   
+
+   static std::vector<std::string> const archs = APT::Configuration::getArchitectures();
+   static bool const multiArch = archs.size() <= 1;
+
    string Package;
    string Package;
    string const pkgArch = Ver.Arch(true);
    string const pkgArch = Ver.Arch(true);
    string Version;
    string Version;
@@ -620,8 +623,18 @@ bool debListParser::ParseDepends(pkgCache::VerIterator Ver,
       Start = ParseDepends(Start,Stop,Package,Version,Op);
       Start = ParseDepends(Start,Stop,Package,Version,Op);
       if (Start == 0)
       if (Start == 0)
 	 return _error->Error("Problem parsing dependency %s",Tag);
 	 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;
 	 return false;
       if (Start == Stop)
       if (Start == Stop)
 	 break;
 	 break;