Restore '-A' flag for pkg-install.
Figure non-automatic packages without upgrades.
Add missed prototypes.
Do not order queries for CONDITION match.
Add guess function for install candidates finding.
Merge branch 'upgrade-candidates'
pkg-query: correct grammar
Build sqlite3 with usleep(3) support so it does not round all sleeps up to second intervals.

This helps our transaction code tremendously which tries to use
sqlite3_sleep(250) while SQLITE_BUSY is returned
Lower transaction sleep a bit and raise the amount of retries to compensate.

This along with HAVE_USLEEP greatly helps parallel read-only transactions
Convert SQLITE_BUSY retries into a uniform MACRO
Handle SQLITE_BUSY by retrying when grabbing lock
Move pkg_lock schema into normal schema upgrade path

This avoids SQLITE_BUSY and the need to try to recreate the
tables on every exec. pkgdb_upgrade() uses pkgdb_transaction_begin()
which already handles SQLITE_BUSY.
Temporary disable backtraces they are not ready yet for prime
Release 1.3.0.b2
Move unicity in the database into the tuple: (origin, name)

This allows to move out from origin within a seamless upgrade path
Move unicity handling from the table schema into external index to allow
more and simpler flexibility in the futur where we could want unicity on
(origin, name, arch)
Bump local db version
Load uniqueid into struct pkg
Compute rdepends base on the unique id
dependency loading now respect unique id
More uniqueid usage

Change annotate to conform unique id
Change pkgdb_unregister_pkg to use package id and to use package row id