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

3 Commits

Author SHA1 Message Date
Werner Almesberger
0229051f07 qpkg: change prerequisite resolution order to be fully depth-first
Until now, when considering adding a package, we processed its
dependencies after completing the current list of dependencies. E.g.,
if we had a package A that depended on B and C, B depended on D, and C
depended on E, then the sequence would have been A, B, C, ...

We now process the dependencies of a package immediately after
considering the package, so the sequence above would become A, B, D,
C, ...

The advantage of the new order is that it becomes easier to follow the
dependency tree, which will be beneficial for loop detection and for
ordering packages by installation order.

- prereq.c (resolve): change prerequisite resolution order such that the
  dependencies of the package being considered are processed immediately,
  instead of deferring them until the end of the current dependency list
- prereq.c (prereq): we can now pass the list of dependencies directly,
  without needing a list of lists element
- test/resorder: test resolution order
2010-11-21 17:34:17 -03:00
Werner Almesberger
5a0444fd7e qpkg/prereq.c (prereq): removed confused false error avoidance
The original idea was to just copy "stack" (now called "installed") to
"best" when done. In this case, "best" would remain NULL if "install"
had no entries, which would then be interpreted as a failure to resolve
the prerequisites.

However, since we allocate a new list for "best" anyway, this concern
no longer exists, and we can also get rid of the contorted mechanism
that was designed to work around this problem. (It was never put into
action because I wanted to make a regression test for it first.)

- prereq.c (prereq): removed commented-out and nonsensical avoidance of
  false error
- test/prereq: added test case with no prerequisite
2010-11-21 10:22:37 -03:00
Werner Almesberger
2c953a5d1a qpkg: added regression test harness and a few tests
- Makefile (test, tests, valgrind): new targets to run regression tests
- test/Common: test harness (adapted from fped)
- test/minpkg: test minimum package definition
- test/prereq: test basic prerequisite queries
2010-11-21 04:32:04 -03:00