[pacman-dev] [patch] alpm_removedeps bug+fix && alpm_depcmp-discussion

ngaba at petra.hos.u-szeged.hu ngaba at petra.hos.u-szeged.hu
Tue Jun 19 08:47:20 EDT 2007

> To Nagy :
> I don't even understand why this assumption is needed :
> * assumptions: alpm_list_add adds new member to the end of the list,
> so we can reuse the list pointer
> As far as I can tell, this isn't needed, so please explain more in detail :)

OK, you are right. To be perfect, this is not needed, but this cause a 
big performance
boost: If this assumption is true, you can simply leave the "ready" 
variable and the
"while(!ready)" stuff, because every dependencies will be found in the 
first loop (ready
is just a safety variable now...). This wonderful fact proves the 
speed-up IMHO.
However, if we want to keep the nice feature that this function keeps 
topo sort, this is
needed. However, the algorithm (expected to) works fine when input list 
is not topo
sorted (I put it in the comment just as a suggestion, because topo sort 
is slow, and
small list's topo-sort is faster).
Anyway, this assumption is _used_ in alpm_resolvedeps, so I put that 
comment to the patch
as a reminder.

Bye, ngaba

PS: It would be nice if someone created "-Rs" pactests to test this patch.
PS2: Xavier, sry for replying to your mail address earlier

This message was sent using IMP, the Internet Messaging Program.

More information about the pacman-dev mailing list