On 4/17/07, Nagy Gabor <ngaba@petra.hos.u-szeged.hu> wrote:
I'd rather convert the dep list itself to a list of packages (all from the package cache, loaded on demand), which makes the topo sort much easier. Yes, I also thought something similar ;-) We may also add a (void *)tmp entry to pmpkg_t struct (or to pmdepend_t ?) to make our life easier. Anyway, thinking packages with dependencies as a graph in the whole libalpm is much nicer and more efficient, but it's difficult to implement because the vertexes and edges change often and we cannot compute the whole graph (of all packages) just parts which are needed. Back to deps.c: I think that the slow sortbydeps should be merged into checkdeps (which should be merged into resolvedeps:-) instead of running it separately. Because as I think while we do a topological sort we can recognize that a dependency is missing (checkdeps) and optionally we can resolve it (resolvedeps). I don't like the slow way that resolvedeps uses now.
Bye, ngaba
-1 on (void *) pointers. These have already gotten us in trouble. Type correctness is maybe something I'm a stickler on, but it solves a lot of errors down the road when new coders come on board. -Dan