summaryrefslogtreecommitdiff
path: root/apt-pkg/cacheset.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/cacheset.cc')
-rw-r--r--apt-pkg/cacheset.cc16
1 files changed, 4 insertions, 12 deletions
diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc
index 6a625184e..6b31a4fff 100644
--- a/apt-pkg/cacheset.cc
+++ b/apt-pkg/cacheset.cc
@@ -153,12 +153,8 @@ bool CacheSetHelper::PackageFromRegEx(PackageContainerInterface * const pci, pkg
continue;
pkgCache::PkgIterator Pkg = Grp.FindPkg(arch);
if (Pkg.end() == true) {
- if (archfound == std::string::npos) {
- std::vector<std::string> archs = APT::Configuration::getArchitectures();
- for (std::vector<std::string>::const_iterator a = archs.begin();
- a != archs.end() && Pkg.end() != true; ++a)
- Pkg = Grp.FindPkg(*a);
- }
+ if (archfound == std::string::npos)
+ Pkg = Grp.FindPreferredPkg(true);
if (Pkg.end() == true)
continue;
}
@@ -213,12 +209,8 @@ bool CacheSetHelper::PackageFromFnmatch(PackageContainerInterface * const pci,
continue;
pkgCache::PkgIterator Pkg = Grp.FindPkg(arch);
if (Pkg.end() == true) {
- if (archfound == std::string::npos) {
- std::vector<std::string> archs = APT::Configuration::getArchitectures();
- for (std::vector<std::string>::const_iterator a = archs.begin();
- a != archs.end() && Pkg.end() != true; ++a)
- Pkg = Grp.FindPkg(*a);
- }
+ if (archfound == std::string::npos)
+ Pkg = Grp.FindPreferredPkg(true);
if (Pkg.end() == true)
continue;
}