On Thu, Oct 19, 2006 at 07:34:08AM +0200, Frank Küster <[EMAIL PROTECTED]> was 
heard to say:
> Daniel Burrows <[EMAIL PROTECTED]> wrote:
> 
> >   Yeah, I think it's pretty well known that metapackages interact in
> > sometimes surprising ways with dependencies.  I don't think using a
> > Depends would actually help in this case, though; unless I'm mistaken,
> > you'd still get the "remove tetex-extra" choice before the
> > "install latex-beamer" choice.  There are a few other cases where
> > Recommendations are probably inappropriate (including aptitude, whee),
> > but it doesn't generally seem to be a problem.  Except here :P.
> 
> One more thing that I don't understand is why this happens with
> latex-beamer, but the other Recommends of tetex-extra are not
> mentioned.  Is it because latex-beamer again Depends on two of the other
> Recommends: 
> 
> $ apt-cache show tetex-extra | grep Recommends
> Recommends: latex-beamer, latex-xcolor, lmodern, pgf, preview-latex-style, 
> texinfo
> $ apt-cache show latex-beamer | grep Depends
> Depends: pgf (>= 1.00-1), latex-xcolor (>= 2.00-1), tetex-extra | 
> texlive-latex-base

  That's a good question, and something I should have thought about
sooner.

  It looks to me like the other recommendations are in the same
situation, but you don't see an effect from them because

  (a) if we remove or hold back tetex-extra, we refuse to install
      those recommendations in that branch (part of the algorithm), and

  (b) if we install those recommendations and then remove
      tetex-extra, the resulting solution will probably be a superset of
      one that removes tetex-extra without installing the
      recommendations, and the smaller solution is usually generated
      first.  The resolver will suppress the superset in this case.

  This is one place where a Depends would help.  The problem is that
aptitude relies on a simple apt algorithm to get a "mostly right"
starting point for its dependency resolution.  Unfortunately, this
algorithm ignores Recommendations on upgrade.  I think there's an apt
bug on this and IIRC, mvo said that he has a proposed fix for it that I
could look at...I've just been too stretched lately to look at it.

  I think the best solution, then, is probably to arrange for all the
new recommendations to be marked in the first pass; aptitude's own
resolver will produce better results from a better starting point.

> >   Forcing dependencies earlier might make the solution you want show up
> > earlier (and has no ill effects other than slowing down processing), so
> > I might add that and see if it helps.  It won't help in complicated
> > situations, though (e.g., if you have both testing and unstable in your
> > sources.list, which is kind of a pathological case for the resolver).
> 
> I hope such a change won't break other situations...

  Probably not.  There are two basic possibilities:

  (a) the solution post-forcing has a lower score than pre-forcing.  In
      this case it would have ended up at this lower score anyway, so
      its position in the sequence of generated solutions won't change
      (all the solutions with a higher score (*) will be generated
      before aptitude gets around to opening up this solution).

      (*) this is a lie.  Since aptitude doesn't exhaustively search all
          possibilities before generating a solution, a solution that
          looks bad now can get better later.  This is, I think, the
          reason that latex-beamer isn't getting installed -- to get
          to the final state, aptitude has to pass through a state
          that's heavily penalized.

  (a) the solution post-forcing has a higher score than pre-forcing.  In
      this case, it's probably "good" from the algorithm's point of view
      to force the dependencies, since we might find a better solution
      sooner.  This doesn't mean the user will prefer the solution
      that's generated, but it does mean that the order of the solutions
      will respect the weighting factors more (or at least be less
      disrespectful of them).

  Daniel


Reply via email to