summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-11-23 09:54:17 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-11-23 09:54:17 +0100
commit286afa36886b60bea0a17d244f8bddad938f27cf (patch)
tree37843aed0e25c7c4c8cf8c8b0896f9b044827c3c /cmdline
parent2b5c35c7bb915dbd46fefd7c79f05364ba22f93b (diff)
* 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
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-get.cc13
1 files changed, 13 insertions, 0 deletions
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<std::string> 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;
}