diff options
author | Daniel Burrows <dburrows@debian.org> | 2011-05-14 21:03:21 -0700 |
---|---|---|
committer | Daniel Burrows <dburrows@debian.org> | 2011-05-14 21:03:21 -0700 |
commit | 6d5174f0f5561b74dcf02ec11131dbcae8a6b429 (patch) | |
tree | 04182d0226769a124df9264de5b9243f878fdd04 | |
parent | ec9d6281a021d0c3708520c5fd9a8e08ef3b686f (diff) | |
download | aptitude-6d5174f0f5561b74dcf02ec11131dbcae8a6b429.tar.gz |
Ensure that packages are manual after we mark them for install, not before.
Should avoid any surprises due to the new "preserve the auto flag" logic,
although I tested with and without this change and both seemed to work OK.
-rw-r--r-- | src/generic/apt/aptcache.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/generic/apt/aptcache.cc b/src/generic/apt/aptcache.cc index cba35e27..26f2338c 100644 --- a/src/generic/apt/aptcache.cc +++ b/src/generic/apt/aptcache.cc @@ -1099,15 +1099,10 @@ void aptitudeDepCache::internal_mark_install(const PkgIterator &Pkg, { dirty=true; - bool set_to_manual = ((Pkg.CurrentVer().end() && !(*this)[Pkg].Install()) || (!Pkg.CurrentVer().end() && (*this)[Pkg].Delete() && get_ext_state(Pkg).remove_reason == unused)); - if(set_to_manual) - MarkAuto(Pkg, false); - - // MarkInstall and friends like to modify the auto flag, so save it // here and restore it afterwards: bool previously_auto = ((*this)[Pkg].Flags & Flag::Auto) != 0; @@ -1123,6 +1118,9 @@ void aptitudeDepCache::internal_mark_install(const PkgIterator &Pkg, MarkAuto(Pkg, previously_auto); + if(set_to_manual) + MarkAuto(Pkg, false); + get_ext_state(Pkg).selection_state=pkgCache::State::Install; get_ext_state(Pkg).reinstall=ReInstall; get_ext_state(Pkg).forbidver=""; |