summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-07-17 10:53:01 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-08-10 17:27:59 +0200
commitbb0f6a34c4cebea7884de828c011dc85765ff820 (patch)
tree809a630ba606bac6b9050c97f9ecbccc7562244f /apt-pkg/deb
parentecc138f858fab61e0b888d3d13854d1422c3432b (diff)
just-in-time creation for (explicit) negative deps
Now that we deal with provides in a more dynamic fashion the last remaining problem is explicit dependencies like 'Conflicts: foo' which have to apply to all architectures, but creating them all at the same time requires us to know all architectures ending up in the cache which isn't needed to be the same set as all foreign architectures. The effect is visible already now through as this prevents the creation of a bunch of virtual packages for arch:all packages and as such also many dependencies, just not very visible if you don't look at the stats… Git-Dch Ignore
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/deblistparser.cc30
1 files changed, 5 insertions, 25 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 87aa99c6e..1154016a9 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -790,43 +790,23 @@ bool debListParser::ParseDepends(pkgCache::VerIterator &Ver,
return _error->Error("Problem parsing dependency %s",Tag);
size_t const found = Package.rfind(':');
- // If negative is unspecific it needs to apply on all architectures
- if (MultiArchEnabled == true && found == string::npos &&
- (Type == pkgCache::Dep::Conflicts ||
- Type == pkgCache::Dep::DpkgBreaks ||
- Type == pkgCache::Dep::Replaces))
+ if (found == string::npos || strcmp(Package.c_str() + found, ":any") == 0)
{
- for (std::vector<std::string>::const_iterator a = Architectures.begin();
- a != Architectures.end(); ++a)
- if (NewDepends(Ver,Package,*a,Version,Op,Type) == false)
- return false;
- if (NewDepends(Ver,Package,"none",Version,Op,Type) == false)
+ if (NewDepends(Ver,Package,pkgArch,Version,Op,Type) == false)
return false;
}
- else if (found != string::npos &&
- strcmp(Package.c_str() + found, ":any") != 0)
+ else
{
string Arch = Package.substr(found+1, string::npos);
Package = Package.substr(0, found);
// Such dependencies are not supposed to be accepted …
- // … but this is probably the best thing to do.
+ // … but this is probably the best thing to do anyway
if (Arch == "native")
Arch = _config->Find("APT::Architecture");
if (NewDepends(Ver,Package,Arch,Version,Op | pkgCache::Dep::ArchSpecific,Type) == false)
return false;
}
- else
- {
- if (NewDepends(Ver,Package,pkgArch,Version,Op,Type) == false)
- return false;
- if ((Type == pkgCache::Dep::Conflicts ||
- Type == pkgCache::Dep::DpkgBreaks ||
- Type == pkgCache::Dep::Replaces) &&
- NewDepends(Ver, Package,
- (pkgArch != "none") ? "none" : _config->Find("APT::Architecture"),
- Version,Op,Type) == false)
- return false;
- }
+
if (Start == Stop)
break;
}