summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-03-18 18:07:51 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-03-18 18:07:51 +0100
commit306eacf617b8ea8c87b31258c55a5373be4ad946 (patch)
tree86b5a66814f4fba6f2e285600a56023ce0b3bf2b
parent1f530ccb32c17b70b05dd5feee706dc1098a7251 (diff)
generate "negative" dependencies against all architectures of a package
Negative means here Conflicts, Replaces and Breaks - this adds again a whole lot of dependencies.
-rw-r--r--apt-pkg/deb/deblistparser.cc19
1 files changed, 16 insertions, 3 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 84eab44a7..5c9cf6d4b 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -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;