On Thu, Jul 26, 2007 at 03:51:49AM +0200, Jiří Paleček <[EMAIL PROTECTED]> was heard to say: > I have also experienced this bug, with openoffice packages but also other.
I have a feeling this is a separate problem from the original one, since the submitter said the packages being removed weren't garbage-collected. It looks like a legitimate bug, though. > I have debugged this and the problem seems to be in > aptitudeDepCache::apply_solution. > This function marks any package which is not kept or deleted as "auto", > which > means that, in my case, darcs will be marked as auto, and, not having any > rdepends, immediately deselected. This also affects upgrades of non-auto > packages. This is, on my system a case of openoffice.org, because I have > openoffice.org-kde installed. This is an optional package, again no > rdepends. > So instead of upgrading as the resolver promissed, it will be deleted as > unused. That sounds like a correct diagnosis. > When I commented out the line > MarkAuto(pkg, true); > it no longer deleted packages at will. However, I don't think this is the > correct fix. It should mark new packages which were not selected by the > user only, but I don't know how to do it. The attached patch should do the trick; it separates the case of "install a new package" from the case of "install a different version of an already-installed package". Does it work for you? Daniel
diff -r 5ec42fce9483 src/generic/apt/aptcache.cc --- a/src/generic/apt/aptcache.cc Thu Jul 19 07:29:45 2007 -0700 +++ b/src/generic/apt/aptcache.cc Thu Jul 26 19:19:59 2007 -0700 @@ -1428,7 +1428,10 @@ void aptitudeDepCache::apply_solution(co { set_candidate_version(actionver, NULL); internal_mark_install(pkg, false, false); - MarkAuto(pkg, true); + // Mark the package as automatic iff it isn't currently + // installed. + if(curver.end()) + MarkAuto(pkg, true); } } }