From d9933172b31e21862b660c182f7c747802dbaa73 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 19 Apr 2011 11:52:47 +0200 Subject: set hint flags for the problem resolver according to request --- cmdline/apt-internal-solver.cc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'cmdline/apt-internal-solver.cc') 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::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::const_iterator i = install.begin(); + i != install.end(); ++i) { + pkgCache::PkgIterator P = CacheFile->FindPkg(*i); + Fix.Clear(P); + Fix.Protect(P); + } + for (std::list::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; -- cgit v1.2.3