On Sat, Jul 28, 2007 at 07:18:43AM -0700, Daniel Burrows <[EMAIL PROTECTED]>
was heard to say:
> On Sat, Jul 28, 2007 at 01:08:52AM +0200, Jiří Paleček <[EMAIL PROTECTED]>
> was heard to say:
> > On Fri, 27 Jul 2007 15:27:52 +0200, Daniel Burrows <[EMAIL PROTECTED]>
> > wrote:
> > The darcs problem is basicly the same, a hand installed package is marked
> > as auto. The difference is that in the darcs case, it is not a previously
> > installed package (as in the OOo case), but a package which is installed
> > by hand in the same session. (ie. I select an uninstallable version ->
> > resolver offers a (higher) installable version -> apply solution ->
> > aptitude marks it as auto -> no version is installed).
>
> Ah, right. I wasn't thinking properly about the problem before and
> produced a patch that was wrong. Could you see if this one fixes your
> problem?
Sorry, this one.
Daniel
diff -r 20b3e93004bd src/generic/apt/aptcache.cc
--- a/src/generic/apt/aptcache.cc Thu Jul 26 19:24:59 2007 -0700
+++ b/src/generic/apt/aptcache.cc Sat Jul 28 07:35:45 2007 -0700
@@ -1411,6 +1411,7 @@ void aptitudeDepCache::apply_solution(co
{
pkgCache::PkgIterator pkg=i->first.get_pkg();
pkgCache::VerIterator curver=pkg.CurrentVer();
+ pkgCache::VerIterator instver = (*apt_cache_file)[pkg].InstVerIter(*apt_cache_file);
pkgCache::VerIterator actionver=i->second.ver.get_ver();
// Check what type of action it is.
@@ -1429,8 +1430,12 @@ void aptitudeDepCache::apply_solution(co
set_candidate_version(actionver, NULL);
internal_mark_install(pkg, false, false);
// Mark the package as automatic iff it isn't currently
- // installed.
- if(curver.end())
+ // going to be installed. Thus packages that are currently
+ // manually installed don't get marked as auto, packages
+ // that are going to be manually installed don't get marked
+ // as auto, but packages that are being removed *do* get
+ // marked as auto.
+ if(instver.end())
MarkAuto(pkg, true);
}
}