summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2012-06-11 02:06:40 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-06-11 02:06:40 +0200
commit0f485ee50e9bcd75a93f24b632280b5bcc078141 (patch)
treedfc7cd18bdd2a35b430a6cd7a2f6874e28cd7849 /apt-pkg/deb
parentd5648746d4d4ea3f71aae5578a42050385e7b61d (diff)
* apt-pkg/deb/deblistparser.cc:
- add support for arch-specific qualifiers in dependencies
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/deblistparser.cc20
1 files changed, 17 insertions, 3 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 0a7e41538..4948c9be4 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -637,16 +637,18 @@ bool debListParser::ParseDepends(pkgCache::VerIterator &Ver,
if (Section.Find(Tag,Start,Stop) == false)
return true;
- string Package;
string const pkgArch = Ver.Arch();
- string Version;
- unsigned int Op;
while (1)
{
+ string Package;
+ string Version;
+ unsigned int Op;
+
Start = ParseDepends(Start,Stop,Package,Version,Op,false,!MultiArchEnabled);
if (Start == 0)
return _error->Error("Problem parsing dependency %s",Tag);
+ size_t const found = Package.rfind(':');
if (MultiArchEnabled == true &&
(Type == pkgCache::Dep::Conflicts ||
@@ -658,6 +660,18 @@ bool debListParser::ParseDepends(pkgCache::VerIterator &Ver,
if (NewDepends(Ver,Package,*a,Version,Op,Type) == false)
return false;
}
+ else if (MultiArchEnabled == true && found != string::npos &&
+ strcmp(Package.c_str() + found, ":any") != 0)
+ {
+ 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.
+ if (Arch == "native")
+ Arch = _config->Find("APT::Architecture");
+ if (NewDepends(Ver,Package,Arch,Version,Op,Type) == false)
+ return false;
+ }
else if (NewDepends(Ver,Package,pkgArch,Version,Op,Type) == false)
return false;
if (Start == Stop)