Fix segfault on errors emitting.

Function 'pkg_emit_error' calls for pkg_emit_event twice and, moreover,
the first time it is called with uninitialized buffer, hence causing
SIGSEGV while accessing this buffer further. This patch fixes it.
Add cheksums computation for manifests.

Add sha256 checksums for manifests generated. Document this change
in doxygen style comment. Generate digest file for repository in
format:
<origin>: <sha256>\n
...

Fix memory corruption during getting package files list by setting
'file' variable to NULL as it is intended.
Add -F flag to pkg-install.

Add -F flag that skip installation of packages to pkg install command,
the semantics of this flag is similar to one used in pkg upgrade
command.

Style fix for related manpages.
Merge pull request #482 from vstakhov/master

Add checksums for manifests, fixed several bugs with memory corruption, add -F option to pkg-install.
Use .txz for digests file as well.

Compress the digests of manifests to .txz format.

Update usage definitions for upgrade and install commands to
reflect new -F flag.
Check for archiving and sign errors in repo cmd.

Check return values of RSA_sign and archive_write functions
and deny creating repositories with either write errors or
signing errors.
Add manifestdigest field to repository.

Add manifestdigest field to local and remote repositories, create
appropriate index and upgrade schema.
Support glob patterns in pkg-which.

Add support of glob patterns to pkg-which.

Suggested by:	az
Fix memory corruption if www was passed directly in manifest

Conflicts:
	libpkg/pkg_create.c
Make comment, description, and www mandatory to make a valid package because they are!
Add -A option to pkg-add.

Add -A option with the same semantic as -A option for pkg-install
that allows adding a package as orphan.

Note in a manpage that pkg add may accept several packages as command
line arguments.

Fix line feeding in case of dependency miss error that breaks
visible output.
Add -f and -q options to pkg-add.

Add -f option to pkg-add that allows force install of package even
if it is already installed.

Add -q option to turn on quiet mode of pkg-add.
Write offsets of manifests to digests file.

To speed up access to the manifests desired it is useful to store
offsets in manifest and filelist files inside digest file. Then we
may read digests and quickly obtain manifests and the lists of files
by seeking to the desired position and skipping complete yaml file
parsing.
Sort digests list by origin.

We want to sort digest lists in the same way we will use in update
procedure, hence save it sorted instead of sort it each time
downloaded.
Set mtime for remote repo from a remote server.

Some proxies including nginx expect exact match for If-Modified-
Since HTTP header that means that mtime MUST be the same as it
is returned by HTTP server. Luckily libfetch parses HTTP Date
header returned by HTTP server, hence use mtime returned from
server instead of playing with 'magic' numbers, such as adding
one minute to mtime.

Begin to split pkg_update function, since it is overloaded with
code.
Fix fatal error if repository is not modified.

If a remote server returns 304 error it should not be treated as
EPKG_FATAL that generally prevent remote repository from working.
Do not write to unconnected event pipe.

If a event pipe is not connected it is a bad idea to write something
there pretending it is connected. Hence, close and reset descriptor
to -1 in case of connection error.
Forced mode ignores local conflicts as well.

Forced mode is designed to install a package in some tricky cases,
therefore it should turn on permissive mode implicitly to allow
installation even in case of local conflicts.
Updated uthash.h and utlist.h to 1.9.8

gcc48 could not successfully build pkgng with uthash 1.9.7. The current
version is now updated to 1.9.8, see: https://github.com/troydhanson/uthash/commit/5b2ef5e9c96358e39be72badaab6959ca19e7c61
Patch libelf to build with gcc48

see https://sourceforge.net/apps/trac/elftoolchain/ticket/415