Unify the mirroring type into one single option:

MIRROR_TYPE which can take the folloing arguments (case insensitive)
http: http mirroring
srv: srv mirroing
anythingbutprevious: no mirroring
Allow users to define the proxies via pkg.conf

pkg uses by default libfetch and thus inherit from the environnement variable
that libfetch supports.

However some users might want to be able to define them only for pkg, now they
can do it via pkg.conf
Fix a wrong warning from gcc on recent stable and current

Reported by:	peter@
Fix uninitialized warnings causing build failure
Do not activate DEBUG_FLAGS by default
Finish fixing gcc stupidity
Directly use calloc instead of malloc + memset
Correctly use calloc
Add the ability to setup the nameserver via pkg.conf or env

That allows to install in a jail without resolv.conf for example:
NAMESERVER="8.8.8.8" pkg -j myjail install something
Mimic pkg_delete default: if one of the pkg delete args contains * then switch to MATCH_GLOB
Add new pkgdb_access() function to test if process has the right
access levels to continue.  Now takes notice of $INSTALL_AS_USER in
the environment.
Use EPKG_ENOACCESS for consistency with EPKG_ENODB
Add error code for insecure permissions on databases
Rewrite pkgdb_access to actually test what we're interested in:

  * Are the permissions on the DB too lax?

  * Do we have the level of (read,write,create) access we need.

'create' access translates into 'read,write' access on the enclosing
directory.
Instead of testing geteuid() == 0, instead, test what we really mean:
the package database (local.sqlite) has secure permissions, and the
euid of the process as appropriate read / write access (including to
create the DB)
Fix brain-o.  Copy the directory, not what we just tested to be a NULL
pointer.

Tweak error message slightly.
Fixes #414 -- pkgng should be usable as an ordinary user when
INSTALL_AS_USER is set in the environment.

It's insecure if the package DB is owned by another user when root is
doing stuff.

When INSTALL_AS_USER is set, allowed owners of the pkg DB are root or
the euid of the process.  The egid of the process can have write
access.
Fix the build: don't use 'access' as a variable name because that
clashes with access() which ticks off gcc.  Add err.h to rquery.c
because without it use of warnx() ticks off clang...
Say 'yes' or '!yes' not 'yes == true' or 'yes == false'
Consistentify boolean usage