diff options
| -rw-r--r-- | apt-pkg/solver3.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index c32a5db29..7f382646a 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -351,9 +351,17 @@ bool APT::Solver::Install(pkgCache::PkgIterator Pkg, Var reason, Group group) return false; bool anyInstallable = false; + // Insert the work item. + Work workItem{Var(Pkg), depth(), group}; for (auto ver = Pkg.VersionList(); not ver.end(); ver++) - if ((*this)[ver].decision != Decision::MUSTNOT) - anyInstallable = true; + { + if (IsAllowedVersion(ver)) + { + workItem.solutions.push_back(ver); + if ((*this)[ver].decision != Decision::MUSTNOT) + anyInstallable = true; + } + } if (not anyInstallable) { @@ -364,11 +372,6 @@ bool APT::Solver::Install(pkgCache::PkgIterator Pkg, Var reason, Group group) return false; } - // Insert the work item. - Work workItem{Var(Pkg), depth(), group}; - for (auto ver = Pkg.VersionList(); not ver.end(); ver++) - if (IsAllowedVersion(ver)) - workItem.solutions.push_back(ver); std::stable_sort(workItem.solutions.begin(), workItem.solutions.end(), CompareProviders3{cache, policy, Pkg, *this}); assert(workItem.solutions.size() > 0); |
