lib/db: add support for dependency sections

add set_dependency_databases() method
compute the package states of the dependency dbs

Signed-off-by: Andreas Beckmann <debian@abeckmann.de>
p-m: load dependency sections

Signed-off-by: Andreas Beckmann <debian@abeckmann.de>
p-r: load dependency sections

Signed-off-by: Andreas Beckmann <debian@abeckmann.de>
p-r: cache the most recently used base section

recomputing the package states is a bit expensive (cpu)
caching them all is very expensive (memory)

Signed-off-by: Andreas Beckmann <anbe@debian.org>
lib/db: lookup package state recursively

for packages that do not exist in the current db try the
dependency dbs before falling back to does-not-exist

only recurse one level to avoid infinite loops

Signed-off-by: Andreas Beckmann <debian@abeckmann.de>
lib/db: lookup providers recursively

return the union of the providers from the current db
and all dependency dbs

Signed-off-by: Andreas Beckmann <debian@abeckmann.de>
lib/db: lookup packages recursively

Signed-off-by: Andreas Beckmann <debian@abeckmann.de>
lib/db: lookup package dependencies recursively

Signed-off-by: Andreas Beckmann <debian@abeckmann.de>