diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2011-04-19 11:52:47 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2011-04-19 11:52:47 +0200 |
commit | d9933172b31e21862b660c182f7c747802dbaa73 (patch) | |
tree | b86f32a5d27fb0e614c5e5901358b26f798179a9 /cmdline/apt-internal-solver.cc | |
parent | 69a788359e1ff895efd32348ab6d610bc72794dd (diff) |
set hint flags for the problem resolver according to request
Diffstat (limited to 'cmdline/apt-internal-solver.cc')
-rw-r--r-- | cmdline/apt-internal-solver.cc | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index 83d79e42a..83a671a96 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -104,11 +104,28 @@ int main(int argc,const char *argv[]) /*{{{*/ std::cerr << "Failed to apply request to depcache!" << std::endl; return 3; } + + pkgProblemResolver Fix(CacheFile); + for (std::list<std::string>::const_iterator i = remove.begin(); + i != remove.end(); ++i) { + pkgCache::PkgIterator P = CacheFile->FindPkg(*i); + Fix.Clear(P); + Fix.Protect(P); + Fix.Remove(P); + } + + for (std::list<std::string>::const_iterator i = install.begin(); + i != install.end(); ++i) { + pkgCache::PkgIterator P = CacheFile->FindPkg(*i); + Fix.Clear(P); + Fix.Protect(P); + } + for (std::list<std::string>::const_iterator i = install.begin(); i != install.end(); ++i) CacheFile->MarkInstall(CacheFile->FindPkg(*i), true); - pkgProblemResolver Fix(CacheFile); + if (Fix.Resolve() == false) { EDSP::WriteError("An error occured", output); return 0; |