summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2015-03-09 18:11:10 +0100
committerMichael Vogt <mvo@ubuntu.com>2015-05-22 16:14:54 +0200
commit314b47542c57d0a12c55dd1dd334cf233a33fcfb (patch)
tree451954389d5316452eeb220969e9f8b9b03d0128 /apt-pkg/deb
parentf4a91278c65b156c1addf27b0b05b029692959e8 (diff)
parse arch-qualified Provides correctly
The underlying problem is that libapt-pkg does not correctly parse these provides. Internally, it creates a version named "baz:i386" with architecture amd64. Of course, such a package name is invalid and thus this version is completely inaccessible. Thus, this bug should not cause apt to accept a broken situation as valid. Nevertheless, it prevents using architecture qualified depends. Closes: 777071
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/deblistparser.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 4eef66c2b..3941cf2f2 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -817,10 +817,16 @@ bool debListParser::ParseProvides(pkgCache::VerIterator &Ver)
while (1)
{
Start = ParseDepends(Start,Stop,Package,Version,Op);
+ const size_t archfound = Package.rfind(':');
if (Start == 0)
return _error->Error("Problem parsing Provides line");
if (Op != pkgCache::Dep::NoOp && Op != pkgCache::Dep::Equals) {
_error->Warning("Ignoring Provides line with non-equal DepCompareOp for package %s", Package.c_str());
+ } else if (archfound != string::npos) {
+ string OtherArch = Package.substr(archfound+1, string::npos);
+ Package = Package.substr(0, archfound);
+ if (NewProvides(Ver, Package, OtherArch, Version) == false)
+ return false;
} else if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign) {
if (NewProvidesAllArch(Ver, Package, Version) == false)
return false;