summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-internal-solver.cc19
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;