Put basenames in the conflict dependency cache

This makes the fingerprinting code work for file conflicts of
installed packages.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Also build cache file requires of installed packages

This speeds up erasure/update of packages with a large amount of files
quite a bit. The cost of building the cache seems to be just a couple
of msecs, and it just needs to be done once for the complete transaction
set.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Use a more reasonable initial size for requires cache

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Use IteratorFileNum in checkInstDeps

The code used to loop over all dependencies instead of using
the information from the database.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Handle ancient payloads without ./ prefix again (RhBug:1122004)

- Strip any prefixes and convert all paths to relative in rpmfnFindFN()
  and to match that, convert directories to relative in cmpPoolFn().
  This covers looking up "normal" absolute paths, payload paths with
  or without prefix and also srpm paths which have always (?) been just
  simple non-prefixed basenames.
- Fixes a regression introduced during payload refactoring, possibly
  commit 3c28dcdb6546a2be543ef3beeb893d071fc73205
Introduce a simple score system for determining best providers in ordering

- Look at all providers and calculate a simple score for them:
  We want to prefer self-provides during ordering (RhBug:1111349)
  but only when other things are equal, coloring needs to prevail.
  Otherwise ordering can miss crucial dependencies to the preferred
  arch packages whose files are actually laid down: eg on x86_64
  Fedora, both glibc.i686 and glibc.x86_64 provide and require
  /sbin/ldconfig, but only installing glibc.x86_64 will actually
  get the file on disk for itself and others to use, so glibc.i686
  cannot satisfy its own /sbin/ldconfig provide, crazy as it is.
- Also fixes a memleak on self-provided dependencies introduced
  in commit 6b6f8e6ecba05c69e4ecfc0ef6981a920b4b0eb6