pacman-db-upgrade: do not mangle file lists

grep'ing out blank lines and sorting output thoroughly breaks any file
lists with %BACKUP% entries which must be separated from the file list
by a blank line.  Adds a custom function to ensure that all paths
printed are non-empty and unique.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
sync.c: download packages before starting commit

download_files sets the transaction state to STATE_DOWNLOADING.
Modifying the state after it has already been set to STATE_COMMITTING
created a brief window where SIGINT would fail to interrupt the process
and caused interrupted downloads to result in a 'transaction started'
message in the log with no matching transaction end.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
conf.c: store repo settings in dedicated struct

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
conf.c: use masks for siglevel inheritance

This will allow pacman to parse its config file in a single pass and
removes the need for the *_SET siglevels in alpm that were only required
for pacman's siglevel inheritance.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
conf.c: parse config in a single pass

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
ini.c: remove final callback call

Storing repo information removes the need for the final callback.  This
allows the call signature to be re-purposed for indicating read errors.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
ini.c: move Include parsing to conf.c

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
ini.c: remove unnecessary helper function

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
ini.c: remove empty section name restriction

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
ini.c: remove useless key check

key points to a statically allocated string, it can't be NULL.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
ini.c: move error output into conf.c

Move the remaining output into conf.c by notifying the callback of read
errors.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
add alpm_filelist_contains_glob

Efficiently search file lists for globs using leading
literal chunks.  Useful for hooks.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
wip: add hook backend