Fix the debug output to show correctly whether it's a repo schema
upgrade or downgrade
Use MAX* cosistently

pkg used MAXPATHLEN, MAXLOGNAME and PATH_MAX inconsistently,
sometimes path[MAXPATHLEN] and sometimes path[MAXPATHLEN + 1].

Since those constants already include the trailing '\0' and snprintf's
size parameter also does, it was changed to path[MAXPATHLEN] (or
MAXLOGNAME, PATH_MAX) everywhere.
Where we use a fixed size char array as a buffer or as a member of a
structure, use the sizeof() operator later in the same scope when we
need to know the length of the array.

Fix calls to:

    snprintf(), pkg_snprintf()
    strlcpy()
    dn_expand()
Merge branch 'master' of git://github.com/grembo/pkg into grembo-master
Document the ALIAS keyword from pkg.conf

Fixes: #676