Bug#431935: Resolver deleting packages

2007-07-28 Thread Daniel Burrows
On Sat, Jul 28, 2007 at 05:00:30PM +0200, Jiří Paleček <[EMAIL PROTECTED]> was 
heard to say:
> Yes, this seems to work.

  Great, I don't need the big compressed file in that case.

Thanks,
  Daniel




Bug#431935: Resolver deleting packages

2007-07-28 Thread Jiří Paleček
On Sat, 28 Jul 2007 16:36:59 +0200, Daniel Burrows <[EMAIL PROTECTED]>  
wrote:


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?


Yes, this seems to work.

   Jiri Palecek



Bug#431935: Resolver deleting packages

2007-07-28 Thread Jiří Paleček
On Sat, 28 Jul 2007 16:18:43 +0200, Daniel Burrows <[EMAIL PROTECTED]>  
wrote:


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?


I'd love to, but there's no attachment :-(

>aptitude-create-state-bundle (assuming you have aptitude 0.4.6) and  
send

>me the output?

I don't have aptitude 0.4.6, and probably won't upgrade till apt 0.7.4  
gets

into testing. Maybe I could create a repository which exhibits the
behaviour,
would that be OK?


  Basically, I'd need the following stuff in a tarball:

$HOME/.aptitude
/var/lib/aptitude
/var/lib/apt
/var/cache/apt/pkgcache.bin
/var/cache/apt/srcpkgcache.bin
/etc/apt
/var/lib/dpkg/status


It has 24MB compressed. Still interrested?

  Jiri Palecek



Bug#431935: Resolver deleting packages

2007-07-28 Thread Daniel Burrows
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);
 	}
 }



Bug#431935: Resolver deleting packages

2007-07-28 Thread Daniel Burrows
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?

> >aptitude-create-state-bundle (assuming you have aptitude 0.4.6) and send
> >me the output?
> 
> I don't have aptitude 0.4.6, and probably won't upgrade till apt 0.7.4 gets
> into testing. Maybe I could create a repository which exhibits the  
> behaviour,
> would that be OK?

  Basically, I'd need the following stuff in a tarball:

$HOME/.aptitude
/var/lib/aptitude
/var/lib/apt
/var/cache/apt/pkgcache.bin
/var/cache/apt/srcpkgcache.bin
/etc/apt
/var/lib/dpkg/status

> BTW, there's something bad about aptitude package's uploads (which might  
> not be
> caused by you). There are some versions (eg. 0.4.5-1 and 0.4.6-1) in the  
> changelog
> whose uploads are not seen on packages.qa.d.o and bugs closed by these  
> versions
> are still open in the BTS.

  AFAIK I've done the right thing; the BTS seems to have gotten really
flaky about closing bugs since version awareness was introduced, though.
I just noticed that 0.4.6 was missing a moment ago -- but I hadn't noticed
that 0.4.5's bugs didn't get closed.  Good catch there!

  Daniel




Bug#431935: Resolver deleting packages

2007-07-27 Thread Jiří Paleček
On Fri, 27 Jul 2007 15:27:52 +0200, Daniel Burrows <[EMAIL PROTECTED]>  
wrote:


On Fri, Jul 27, 2007 at 12:15:22PM +0200, Jiří Paleček <[EMAIL PROTECTED]>  
was heard to say:

  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?


Well, yes and no. It does correctly the openoffice.org part, but the  
darcs

problem remains.


  Maybe I'm not understanding the darcs problem.  Could you run


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).


aptitude-create-state-bundle (assuming you have aptitude 0.4.6) and send
me the output?


I don't have aptitude 0.4.6, and probably won't upgrade till apt 0.7.4 gets
into testing. Maybe I could create a repository which exhibits the  
behaviour,

would that be OK?

BTW, there's something bad about aptitude package's uploads (which might  
not be
caused by you). There are some versions (eg. 0.4.5-1 and 0.4.6-1) in the  
changelog
whose uploads are not seen on packages.qa.d.o and bugs closed by these  
versions

are still open in the BTS.

Regards
Jiri Palecek



Bug#431935: Resolver deleting packages

2007-07-27 Thread Daniel Burrows
On Fri, Jul 27, 2007 at 12:15:22PM +0200, Jiří Paleček <[EMAIL PROTECTED]> was 
heard to say:
>>   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?
>
> Well, yes and no. It does correctly the openoffice.org part, but the darcs
> problem remains.

  Maybe I'm not understanding the darcs problem.  Could you run
aptitude-create-state-bundle (assuming you have aptitude 0.4.6) and send
me the output?

  Daniel




Bug#431935: Resolver deleting packages

2007-07-27 Thread Jiří Paleček

Hello,

On Fri, 27 Jul 2007 04:22:51 +0200, Daniel Burrows <[EMAIL PROTECTED]>  
wrote:


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'm not quite sure about that. The symptoms are just the same, and the
submitters deleted packages are optional packages, too. Maybe it's
just a misunderstanding, or something.


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?


Well, yes and no. It does correctly the openoffice.org part, but the darcs
problem remains.

Regards
Jiri Palecek



Bug#431935: Resolver deleting packages

2007-07-26 Thread Daniel Burrows
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);
 	}
 }
 }



Bug#431935: Resolver deleting packages

2007-07-25 Thread Jiří Paleček

Hello,

I have also experienced this bug, with openoffice packages but also other.

For example, say I want to install darcs. So I press + on darcs, and there
are two versions of darcs in the archive. According to my preferences, the
lower one is selected. However, that version is uninstallable on my system,
so resolver pops up and proposes to install the higher version, and upgrade
something else. After pressing !, only the upgrade is marked.

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.

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.

Regards
Jiri Palecek


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]