diff options
author | Daniel Hartwig <mandyke@gmail.com> | 2012-05-30 16:26:11 +0800 |
---|---|---|
committer | Daniel Hartwig <mandyke@gmail.com> | 2012-05-30 16:26:11 +0800 |
commit | 18a9315a016f2f35d16955d5aa928efa88710d03 (patch) | |
tree | 5557976076c68e26ac92bf18335f0494c6062155 | |
parent | ebe6487822a72e8701b87c71d64da87577022a1b (diff) | |
download | aptitude-18a9315a016f2f35d16955d5aa928efa88710d03.tar.gz |
Restore candidate version on undo, keep
Previously, undo incorrectly restored the candidate
to be currently installed version. Keep did not
restore it at all.
Closes: #529403
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | src/generic/apt/aptcache.cc | 7 |
2 files changed, 8 insertions, 5 deletions
@@ -48,6 +48,12 @@ earlier releases. * [cmdline]: Exit with non-zero status when a package run is aborted. (Closes: #293008) + * Restore candidate version on undo, keep + + Previously, undo incorrectly restored the candidate + to be currently installed version. Keep did not + restore it at all. (Closes: #529403) + - Cosmetic and UI bugs: * [curses]: Adjust default widths of localized columns: diff --git a/src/generic/apt/aptcache.cc b/src/generic/apt/aptcache.cc index 36d8f63a..0df4ee9f 100644 --- a/src/generic/apt/aptcache.cc +++ b/src/generic/apt/aptcache.cc @@ -1209,6 +1209,7 @@ void aptitudeDepCache::internal_mark_keep(const PkgIterator &Pkg, bool Automatic if(was_garbage_removed) MarkAuto(Pkg, false); + set_candidate_version(GetCandidateVer(Pkg), NULL); pkgDepCache::MarkKeep(Pkg, false, !Automatic); pkgDepCache::SetReInstall(Pkg, false); @@ -1258,11 +1259,7 @@ void aptitudeDepCache::set_candidate_version(const VerIterator &ver, if(set_to_manual) MarkAuto(ver.ParentPkg(), false); - - - // Use the InstVerIter instead of GetCandidateVersion, since - // that seems to store the currently to-be-installed version. - VerIterator prev=(*this)[(ver.ParentPkg())].InstVerIter(GetCache()); + VerIterator prev=(*this)[(ver.ParentPkg())].CandidateVerIter(GetCache()); aptitude_state &estate = get_ext_state(ver.ParentPkg()); |