[Aptitude-devel] How to get two-stage install marking into the GUI?
dburrows at debian.org
Fri Dec 5 04:04:53 UTC 2008
Say I have two packages A and B. A depends on B, but I the user want
to install both packages. So I select A and B and mark them for
installation. Some time later, I'm tired of A so I remove it. Now what
happens? At the moment, B gets removed. I don't think we can do
anything about this (aside from exposing automatic status in the GUI) if
the user picks A and B separately. But at the command-line, aptitude
handles this correctly when both are installed in the same shot:
$ aptitude install A B
... neither A nor B is marked as automatic ...
The difference is that the command-line version installs packages in
two passes. First it just turns on the "install" flag for everything
being installed (and the "remove" flag for everything being removed),
then it does a second pass where it asks apt to greedily resolve
dependencies (by setting the "autoinst" flag to true). In the GUI,
this is made a bit more complicated by the fact that the install /
remove code is broken up and hidden behind virtual interfaces.
Another place where you'd see this is when A depends on "C | B": with
a two-pass solution, only A and B end up being installed, but the
current code will also drag in C (because B isn't being installed when
A is selected).
My current plan is to add a flag to the virtual interface indicating
whether to turn autoinst on, or perhaps make it more generic and have
it say whether we're in the first pass. This feels a little hacky, but
I can't see any better resolution. Does anyone see a better approach?
I've attached my current solution as a patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 5724 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/aptitude-devel/attachments/20081204/3acab141/attachment.patch
More information about the Aptitude-devel