- TODO: added section for tasks done
- TODO: search tree optimization is done
- TODO: added idea of supporting other database formats in the same family
- Makefile: added automatic dependenceies (needs SHELL = /bin/bash)
- Makefile: added non-verbose builds
- Makefile (jlime): set CC_normal instead of CC, so that also cross-builds
can be non-verbose
- Makefile (openwrt): new target to cross-compile for OpenWRT with uClibc
- Makefile (spotless): added "spotless" target
- gobble.c: uClibc may not have posix_madvise, so replace it with a dummy
if building for uClibc
If the package database is sane, then we don't need to check that all
the field names match what we expect. This saves a few more CPU cycles.
However, if anything goes wrong, the consequences may be unpleasant.
Thus, we default to the slow but safe approach.
- jrb.h, jrb.c (jrb_find_or_insert): new function to look for a node and
to insert a new one if not found
- id.c (make_id): use jrb_find_or_insert to avoid looking up new nodes
twice
- TODO: report the improvement
- 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.