summaryrefslogtreecommitdiff
path: root/cmdline/apt-get.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-02-07 13:08:43 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-02-07 13:08:43 +0100
commitbea417121247afe00cdd4ba13215544d5b5d3262 (patch)
tree72a972560ba2589c1b7ae0f359e4d5a877b7b301 /cmdline/apt-get.cc
parenta1ac2ca85ae4d7c8b3ab3c4e2f3ba6c26202c363 (diff)
always do removes first and set not installed remove packages
on hold to prevent temporary installation later (Closes: #549968)
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r--cmdline/apt-get.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index e93d12c2b..a6377f9f1 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -895,7 +895,11 @@ struct TryToRemove {
if ((Pkg->CurrentVer == 0 && PurgePkgs == false) ||
(PurgePkgs == true && Pkg->CurrentState == pkgCache::State::NotInstalled))
+ {
ioprintf(c1out,_("Package %s is not installed, so not removed\n"),Pkg.FullName(true).c_str());
+ // MarkInstall refuses to install packages on hold
+ Pkg->SelectedState = pkgCache::State::Hold;
+ }
else
Cache->GetDepCache()->MarkDelete(Pkg, PurgePkgs);
}
@@ -1790,14 +1794,7 @@ bool DoInstall(CommandLine &CmdL)
return false;
}
- unsigned short order[] = { 0, 0, 0 };
- if (fallback == MOD_INSTALL) {
- order[0] = MOD_INSTALL;
- order[1] = MOD_REMOVE;
- } else {
- order[0] = MOD_REMOVE;
- order[1] = MOD_INSTALL;
- }
+ unsigned short const order[] = { MOD_REMOVE, MOD_INSTALL, 0 };
TryToInstall InstallAction(Cache, Fix, BrokenFix);
TryToRemove RemoveAction(Cache, Fix);