- id.h (struct tree, comp_id, make_tree), id.c (comp_id, make_tree):
comparison function now takes "void *" (pointing to a "struct id")
arguments instead of "struct id *", for compatibility with jrb
- id.c (comp_id, do_comp_id): added wrapper to convert "void *" back to
"struct id *"
This is a change of the underlying mechanism but it's not polished or
optimized yet. The compare functions haven't been updated, so they work
but produce compiler warnings because of type mismatches.
- Makefile (OBJS): added jrb.o
- id.h, id.c: use jrb instead of own dumb binary trees
- TODO: brag about the efficiency improvement
- jrb.c (recolor, jrb_delete_node, jrb_nblack, jrb_free_tree): add space
to while(...
- jrb.c (jrb_delete_node): flatten deletion of internal node
- rbtest.c (main): add test of jrb_delete_node
This avoids turning a prerequisite search into a massacre of, guessed,
O(sqrt(2^requisites)).
- gobble.c (gobble_buf, compact_pkg): if a package being added has the same
version as an existing package with the same name, merge them and keep
only one
With the reduction of search depth, "prereq abiword" takes about 3 minutes
on my PC. (Obviously, this can still be improved.)
- gobble.c (gobble_buf): if pkg->id->value is NULL, just it as such
- prereq.c (push): abort if trying to consider a package already considered
or installed
- prereq.c (conflicts): before being satisfied with using an installed
package, make sure it really satisfies the requirement
- prereq.c (conflicts): abort if an installed package conflicts
- prereq.c (conflicts): added some debugging output (temporary)
- prereq.c (conflicts): cut the search if we can't do better than a
previous match
Tried to keep next_dep at the beginning, but that's actually unnecessary.
The historical background is that the dependency list pointer was
originally thought to point to the list currently being processes. But
since it's a list following it, we don't need to maintain the original
order.