From 550f6493654e921a8af860694efdb268c9b2a47c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 25 Jul 2011 12:52:50 +0200 Subject: * apt-pkg/deb/deblistparser.cc: - Strip only :any and :native if MultiArch should be stripped as it is save to ignore them in non-MultiArch contexts but if the dependency is a specific architecture (and not the native) do not strip --- apt-pkg/deb/deblistparser.cc | 9 ++++++--- debian/changelog | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 9ae1065a4..651fa2a81 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -461,7 +461,7 @@ const char *debListParser::ConvertRelation(const char *I,unsigned int &Op) * * The complete architecture, consisting of -. */ -static string CompleteArch(std::string& arch) { +static string CompleteArch(std::string const &arch) { if (arch == "armel") return "linux-arm"; if (arch == "armhf") return "linux-arm"; if (arch == "lpia") return "linux-i386"; @@ -500,9 +500,13 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, Package.assign(Start,I - Start); // We don't want to confuse library users which can't handle MultiArch + string const arch = _config->Find("APT::Architecture"); if (StripMultiArch == true) { size_t const found = Package.rfind(':'); - if (found != string::npos) + if (found != string::npos && + (strcmp(Package.c_str() + found, ":any") == 0 || + strcmp(Package.c_str() + found, ":native") == 0 || + strcmp(Package.c_str() + found + 1, arch.c_str()) == 0)) Package = Package.substr(0,found); } @@ -543,7 +547,6 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, if (ParseArchFlags == true) { - string arch = _config->Find("APT::Architecture"); string completeArch = CompleteArch(arch); // Parse an architecture diff --git a/debian/changelog b/debian/changelog index 76d5a2183..fe4b233a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -34,8 +34,12 @@ apt (0.8.15.3) UNRELEASED; urgency=low * apt-pkg/aptconfiguration.cc: - ensure that native architecture is if not specified otherwise the first architecture in the Architectures vector + * apt-pkg/deb/deblistparser.cc: + - Strip only :any and :native if MultiArch should be stripped as it is + save to ignore them in non-MultiArch contexts but if the dependency + is a specific architecture (and not the native) do not strip - -- David Kalnischkies Mon, 25 Jul 2011 12:36:07 +0200 + -- David Kalnischkies Mon, 25 Jul 2011 12:46:19 +0200 apt (0.8.15.2) unstable; urgency=high -- cgit v1.2.3