[pacman-dev] [PATCH] don't use old packages to satisfy dependencies

Nagy Gabor ngaba at bibl.u-szeged.hu
Fri Feb 12 07:42:15 EST 2010


Idézet Henning Garus <henning.garus at googlemail.com>:

> Don't use packages which are updated during the current transaction as
> dependency providers, when computing needed dependencies in resolvedeps.
> This could lead to new dependencies not being pulled in, in situations
> like:
>
> foo-1 provides bar
> baz depends on bar
>
> foo-2 does not provide bar anymore
> baz still depends on bar
> bar is not pulled in because foo-1 is used to satisfy the dependency
>
> Signed-off-by: Henning Garus <henning.garus at gmail.com>
> ---
>
> This should fix the "phonon bug". I am not entirely happy with this,
> because I more or less copy the local db (once more) on every call to
> resolvedeps. Alternatively one could create a joined list from remove
> and trans->add and give it to checkdeps as remove parameter. This would
> do what we want (exclude packages which will be upgraded from the list
> used to compute already satisfied dependencies in checkdeps), but it
> feels wrong.

I start with a sidenote: We have an alpm_list_diff function for  
simplifying the required list operation.

I am not completely satisfied with this solution. It can happen that  
qt is not an explicit target, and it will be pulled *later*, which can  
break an earlier satisfied phonon dependency. However, a "nice" fix  
for this "pulled qt case" is much more difficult.

That's why I prefer a somewhat uglier solution: Since this issue  
haven't showed up until recently, we can agree that this is a rare  
issue. That's why I would not touch (slow down) resolvedeps code, but  
I would insert _after_ resolvedeps a loop like this (pseudo-code):
while(checkdeps(targets)) {resolve_deps(missing_deps)};
Pros:
-In the normal (usual) cases we have zero slowdown. (Even in the  
problematic cases, it is unlikely that more than 2 checkdeps is needed.)
-This can handle the pulled qt case.
Contras:
-Uglier code than yours.
-If we reaches the "resolve_deps(missing_deps)" part, we must turn off  
remove_unresolvable.

I haven't figured out every details yet (and I may overlook something  
here), but I will propose a patch for this at the weeked.

Bye


------------------------------------------------------
SZTE Egyetemi Konyvtar - http://www.bibl.u-szeged.hu
This message was sent using IMP: http://horde.org/imp/




More information about the pacman-dev mailing list