1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-11-15 06:41:53 +02:00
wernermisc/qpkg
Werner Almesberger 0bc4b6046b qpkg: added detection of cyclic dependencies
We define a cyclic dependency as the possibility (!) of the prerequisites
of a package X including a package that depends on X, and issue an error
if encountering such a situation.

Note that, if the dependencies of X can be resolved in a manner that does
not include the cyclic dependency, qpkg will still fail if it encounters
the cycle. Also note that qpkg (at least so far) does no perform an
exhaustive search to ferret out cyclic dependencies.

Furthermore, we don't consider that a cyclic dependency may not necessarily
imply a real life problem. E.g., if a package A contains elements X and
Y, with X needing package B, and the content of package B has a run-time
dependency on Y, the cyclic dependency between A and B would not exist
when considering its constituents. Since we don't have this information, we
just err on the side of caution.

- qpkg.h (enum flags): divide flags into categories (parse-time and
  run-time) and add flag QPKG_ADDING to mark packets whose dependencies we
  are processing
- prereq.c (resolve, prereq): track which packages we're tentatively
  considering for installation and detect cyclic dependencies
- test/cyclic: regression test for detection of cyclic dependencies
- TODO: updated with recent changes
2010-11-21 20:31:20 -03:00
..
test qpkg: added detection of cyclic dependencies 2010-11-21 20:31:20 -03:00
COPYING.GPLv2 qpkg: added README and COPYING.GPLv2 2010-11-20 06:29:57 -03:00
gobble.c qpkg: store dependencies and conflicts in file order 2010-11-21 15:56:55 -03:00
gobble.h qpkg: added copyright headers and changed name to emphasize speediness 2010-11-20 07:29:18 -03:00
id.c qpkg: towards "struct id" without jrb reference - change ID creation 2010-11-21 03:12:00 -03:00
id.h qpkg: give ID2S macro a more "offical" status 2010-11-21 03:25:53 -03:00
jrb.c qpkg/jrb.c: removed unnecessary inclusion of ctype.h and string.h 2010-11-19 22:32:39 -03:00
jrb.h qpkg: optimize duplicate lookup when inserting a new name 2010-11-19 22:20:15 -03:00
LICENSE.jrb qpkg: added James S. Plank's red-black trees 2010-11-19 19:17:47 -03:00
Makefile qpkg: added regression test harness and a few tests 2010-11-21 04:32:04 -03:00
prereq.c qpkg: added detection of cyclic dependencies 2010-11-21 20:31:20 -03:00
prereq.h qpkg: added copyright headers and changed name to emphasize speediness 2010-11-20 07:29:18 -03:00
qpkg.c qpkg/qpkg.c: tighten detection of inconsistent use of Filename: 2010-11-21 08:19:28 -03:00
qpkg.h qpkg: added detection of cyclic dependencies 2010-11-21 20:31:20 -03:00
rbtest.c qpkg: added copyright headers and changed name to emphasize speediness 2010-11-20 07:29:18 -03:00
README qpkg: added copyright headers and changed name to emphasize speediness 2010-11-20 07:29:18 -03:00
README.jrb qpkg: mention in jrb-related files that they've been heavily edited 2010-11-19 20:37:29 -03:00
TODO qpkg: added detection of cyclic dependencies 2010-11-21 20:31:20 -03:00
util.h qpkg/: initial commit (sneak preview only, doesn't work properly yet) 2010-11-19 14:00:15 -03:00

qpkg - Quick package database query
===================================

qpkg is a tool that reads package databases of the kind used by opkg
in OE-derived Jlime (which are very similar to what dpkg and apt use)
and that can answer a number of queries on them.

While being able to perform some of the database operations commonly
found in package managers, qpkg is not a package manager itself. 
However, it may be used to help a package manager do its work faster.


Except for the files jrb.h and jrb.c, this work is distributed under
the terms of the GNU GENERAL PUBLIC LICENSE, Version 2:

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

For your convenience, a copy of the complete license has been included
in the file COPYING.GPLv2.


The implementation of red-black trees, in jrb.h and jrb.c, is
distributed under the terms of the GNU Lesser General Public License,
Version 2.1:

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

For your convenience, the original copyright notice accompanying JRB
and a copy of the license have been included in the files READNE.jrb
and LICENSE.jrb, respectively.


Objectives
----------

The original motivation for qpkg comes from the observation that opkg
consumes inordinate amounts of memory when determining the
prerequisites for installing a package on a given system, and the
proof of concept implementation of a shell script wrapper by Rafael
Zurita, that performs a large subset of the same task with much less
overhead.

qpkg thus aims to load and parse large package databases as quickly
and memory-efficiently as possible, and to provide a number of query
functions that operate on the data.

A second objective is to provide a means to test the integrity of a
package database, and to perform simple "what if" queries, e.g., to
test which packages would become uninstallable if a package was to be
removed or a conflict was to be introduced.

This is to aid not only in general housekeeping of package databases,
but also to assist in generating - at the package level - restricted
distributions derived from a master distribution.