Remove dead code, with new solver we do not need anymore to compare versions in SQL
Refactor 'pkg [-v|-vv|-vvv]' handling

  * Break the large chunks of code to handle dumping config into
    their own files

  * Add whitespace and make everything line up prettily so the
    output is actually readable.

  * Use atexit() to register cleanup functions

  * Change signature of pkg_shutdown() and pkg_plugins_shutdown()
    to void fund(void) appropriately for use with atexit()

  * Consequently use _exit() from within cleanup functions
Update tests to account for modified pkg -vv output.
Simplify incremental update and make it really incremental
Remove garbage :)
Reuse already declared variable when possible
Rename local_pkg to pkg
Do not fall back on legacy repo if up to date
Digest can be NULL if the inplace repository does not have digest yet, workaround that
Fix build with gcc
Add documentation for %b -- provided shared libraries, and clarify
that %B is for required shared libraries.
pkg query and pkg rquery -- pkg_printf()-ify first step.
Add new %N pkg_printf() escape: Repository name, plus doccumentation
and testing for the same.
Use the new %N pkg_printf() format.
Actually, change %N to produce the repo identity -- the tag that is
used in pkg.conf(5) -- rather than repo name: the basename of the
sqlite file and the name the database is mounted as (which is properly
of interest only to the inernals of pkg, and not what we want pkg query
etc. to display).
Use pkg_printf() %N format to print repo identities
Merge branch 'pkg_printf'