From 286afa36886b60bea0a17d244f8bddad938f27cf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 23 Nov 2011 09:54:17 +0100 Subject: * cmdline/apt-get.cc: - ignore foreign architectures if we check if a provides has only one resolver as it's basically the same for the user, so no need to choose --- cmdline/apt-get.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 763f0edad..ca1169401 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -742,6 +742,19 @@ public: Prov = PPkg; found_one = true; } else if (PPkg != Prov) { + // same group, so it's a foreign package + if (PPkg->Group == Prov->Group) { + // do we already have the requested arch? + if (strcmp(Pkg.Arch(), Prov.Arch()) == 0 || + strcmp(Prov.Arch(), "all") == 0 || + unlikely(strcmp(PPkg.Arch(), Prov.Arch()) == 0)) // packages have only on candidate, but just to be sure + continue; + // see which architecture we prefer more and switch to it + std::vector archs = APT::Configuration::getArchitectures(); + if (std::find(archs.begin(), archs.end(), PPkg.Arch()) < std::find(archs.begin(), archs.end(), Prov.Arch())) + Prov = PPkg; + continue; + } found_one = false; // we found at least two break; } -- cgit v1.2.3