From 0f485ee50e9bcd75a93f24b632280b5bcc078141 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Mon, 11 Jun 2012 02:06:40 +0200 Subject: [PATCH] * apt-pkg/deb/deblistparser.cc: - add support for arch-specific qualifiers in dependencies --- apt-pkg/deb/deblistparser.cc | 20 +++++++++++++++++--- apt-pkg/pkgcache.cc | 5 ++++- debian/changelog | 2 ++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 0a7e4153..4948c9be 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) diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index e06e7457..f694a237 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -715,7 +715,10 @@ bool pkgCache::DepIterator::IsIgnorable(PrvIterator const &Prv) const sometimes it is needed to identify these to ignore them… */ bool pkgCache::DepIterator::IsMultiArchImplicit() const { - if (ParentPkg()->Arch != TargetPkg()->Arch) + if (ParentPkg()->Arch != TargetPkg()->Arch && + (S->Type == pkgCache::Dep::Replaces || + S->Type == pkgCache::Dep::DpkgBreaks || + S->Type == pkgCache::Dep::Conflicts)) return true; return false; } diff --git a/debian/changelog b/debian/changelog index 1b33daa4..a89f78de 100644 --- a/debian/changelog +++ b/debian/changelog @@ -70,6 +70,8 @@ apt (0.9.5.2) UNRELEASED; urgency=low [ Thibaut Girka ] * cmdline/apt-get.cc: - complain correctly about :any build-dep on M-A:none packages + * apt-pkg/deb/deblistparser.cc: + - add support for arch-specific qualifiers in dependencies -- David Kalnischkies Wed, 06 Jun 2012 23:54:01 +0200 -- 2.20.1