1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-11-15 10:18:28 +02:00
Commit Graph

9 Commits

Author SHA1 Message Date
Werner Almesberger
a63823e26a qpkg: turn pkg->installed into pkg->flags, allowing for future expansion
- qpkg.h (enum flags, struct pkg): replaced "installed" with "flags", one
  of them being QPKG_INSTALLED
- gobble.c (compact_pkg, gobble_buf), prereq.c (push, resolve): adapted
  for above change
2010-11-20 12:25:45 -03:00
Werner Almesberger
3d1ef02aba qpkg: added copyright headers and changed name to emphasize speediness
- Makefile, gobble.h, gobble.c, id.h, id.c, prereq.h, prereq.c, qpkg.h,
  qpkg.c, rbtest.c: added copyright header
- id.c: include jrb.h (for completeness)
- README: change name from "Query package databases" to "Quick package
  database query"
2010-11-20 07:29:18 -03:00
Werner Almesberger
9481934c9a qpkg: Makefile cleanup and added OpenWRT target
- 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
2010-11-20 07:14:52 -03:00
Werner Almesberger
ed0281f306 qpkg/gobble.c (EXPECT): added variant that just skips over expected text
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.
2010-11-19 22:29:19 -03:00
Werner Almesberger
64c70e77f4 qpkg: use "val" field of jrb nodes instead of keeping one in "struct id"
- id.h (struct id), id.c (make_id): remove field "value"
- gobble.c (compact_pkg, gobble_buf), prereq.c (list_all_packages,
  list_one_package, find_prereq): use id->jrb->val instead of id->value
2010-11-19 22:02:42 -03:00
Werner Almesberger
af27092667 qpkg/gobble.c (gobble_buf): initialize pkg->conflicts and pkg->depends 2010-11-19 21:53:43 -03:00
Werner Almesberger
9b5480ab3e qpkg: merge identical versions in package databases
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
2010-11-19 16:27:55 -03:00
Werner Almesberger
0ca4751b77 qpkg: some cleanup, prerequisite search speedup
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
2010-11-19 15:26:24 -03:00
Werner Almesberger
43b9dc1972 qpkg/: initial commit (sneak preview only, doesn't work properly yet) 2010-11-19 14:00:15 -03:00