diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2011-05-02 13:22:14 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2011-05-02 13:22:14 +0200 |
commit | 98d6aaa8fd2e5c3e9671560781ab23c99f66d7a4 (patch) | |
tree | dd70f57f9e5cb44b4a836419f40cdacca47cf5c7 /apt-pkg/algorithms.cc | |
parent | 288a76d2dcb19aaf0aca6fc9d4898701e5379f5c (diff) |
handle Dir::Bin::Solvers as a list of directories and find the
solver in this list of directories
Diffstat (limited to 'apt-pkg/algorithms.cc')
-rw-r--r-- | apt-pkg/algorithms.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index bbe315ef7..e40f74122 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -743,10 +743,18 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) if (solver != "internal") { -// std::string const file = _config->FindDir("Dir::Bin::Solvers") + solver; - std::string const file = solver; - if (RealFileExists(file.c_str()) == false) - return _error->Error("Can't call external solver '%s' as it is not available: %s", solver.c_str(), file.c_str()); + std::vector<std::string> const solverDirs = _config->FindVector("Dir::Bin::Solvers"); + std::string file; + for (std::vector<std::string>::const_iterator dir = solverDirs.begin(); + dir != solverDirs.end(); ++dir) { + file = flCombine(*dir, solver); + if (RealFileExists(file.c_str()) == true) + break; + file.clear(); + } + + if (file.empty() == true) + return _error->Error("Can't call external solver '%s' as it is not in a configured directory!", solver.c_str()); int external[4] = {-1, -1, -1, -1}; if (pipe(external) != 0 || pipe(external + 2) != 0) return _error->Errno("Resolve", "Can't create needed IPC pipes for EDSP"); |