[PATCH 0/3] Add support for external dependency solvers.
This patch series introduces a plug-in architecture to enable opkg to use
external solvers to solve package dependencies and adds support to use
libsolv as an external solver. A github repo with all three patches can be
found at https://github.com/EricAustinYu/opkg-solver to make it easier to
see these changes.
The first patch sets up the plug-in architecture for enabling the use of an
external solver. The --enable-solver=<SOLVER> option is added to configure.ac
so that if it is enabled, solver specific code will be built and otherwise
opkg's default behaviour is preserved. Some of the code in opkg_cmd.c was moved
to its own file opkg_action.c to make the distinction between what is built with
a solver enabled and what is built without one cleaner. If an external solver is
enabled, opkg_solver.c will be built and opkg_cmd will make calls to the
functions withing opkg_solver. Otherwise, opkg_action.c will be built and opkg
will do what opkg currently does when given commands for install, remove, and
upgrade. To add functionality for a specific solver, first add an option in
configure.ac. Then one can create a file (e.g opkg_solver_somesolver.c) which
will handle calls to the solver, and then edit opkg_solver.c by adding #ifdef
directives (e.g #ifdef HAVE_SOMESOLVER) and calls to functions in that file to
handle install, remove, and upgrade. For an example, see the third patch which
adds functionality for using libsolv.
The second patch attempts to make it so opkg does not build code used for
ad-hoc dependency solving when it is configured to use an external solver.
This is done by moving functions involved in opkg's ad-hoc solving in the
opkg_install.c, opkg_remove.c, and pkg_depends.c files to the end of the file
and surrounding them with an #ifndef HAVE_SOLVER. Because this change involved
shuffling some functions around to minimize the number of #ifndef directives