gendiff: Fix diff of filenames containing spaces

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Unbreak size and archive size generation on big-endian systems

- Fix regression from commit 68bddc353a7ea87ea00ad957858cd509e845e84c,
  accessing a 64bit int as if it were a 32bit one doesn't make it one.
Generate file classes and colors regardless of dependencies (RhBug:1150209)

- File coloring affects ability to install packages on multilib
  systems when relying on color conflict resolution (eg Fedora, RHEL),
  and that has zero to do with whether package dependencies are being
  automatically generated or not. Always generate file classification
  and the coloring based on that.
- Besides fixing coloring where AutoReqProv: 0 is used (ie RhBug:1150209),
  this also fixes two issues when the legacy external dependency generator
  is used: file coloring (RhBug:lotsa) and config() dependency generation.
  So in default configuration, internal vs external depgen now only
  affects whether dependencies are recorded on file or package level,
  otherwise the produced packages should be fully equivalent now.
Refactor current file index from rpmfc struct

- There's no good reason for having a "current index" within fc,
  and the code is easier to read when its clear its just an index
  of a silly for-loop and not something fancier.
Permit NULL spec in rpmCharCheck()

- It can get called when parsing automatically generated dependencies
  and those do not correspond to any particular spec lines
Pass file classifier, not spec, to external depgen helper
We already have the files with buildroot prepended here...
Dont bother passing pkg to rpmfcGenerateDependsHelper()

- This is already available through fc
Move internal vs external depgen decision to rpmfcApply()

- Rename the actual worker functions for consistency, rpmfcApply()
  is now just a simple wrapper around the two
Only add per-file dependencies if we collected them

- Legacy generators dont create a dependency dictionary, in which
  case there's no point adding per-file depends dictionary indexes
  (all zeros) either. Should've probably been in
  commit 05636a7db213e8255d6893c638a80d52390c3527 already.
Eliminate leftover, commented debugging printf()
Unify our internal digest verification functions

- There's nothing md5/sha1-specific in either of these functions,
  the only real difference is whether we're dealing with ascii or
  binary digest.
- Always operate in ascii mode: we need to convert the digest to ascii
  for the return message string anyway, so this only makes things much
  simpler, and this way we wont crash and burn even if the digest tag
  were of mismatching type as rpmtdFormat() can convert anything into
  a string.
Remove incorrect comment

- A string pointer returned rpmlogMessage() is in fact guaranteed to
  be valid until rpmlogClose(), because its malloced separately
  from the owning record. So while the address of the owning record
  can change via realloc(), the contained message stays put.
Eliminate stupid asserts from rpmlogRecMessage and -Priority()
Handle context aquisition failures throughout rpmlog

- Locking can fail, and we need to handle it somehow. Return
  NULL context and handle that in callers, as in "dont crash".
rpmlogSetMask() only needs write-lock on non-zero mask
Delay lock context acquisition to time of actual logging

- Checking whether we need to log requires a (read) lock on entry,
  but most of the time that's all. Hide that locking behind calling
  rpmlogSetMask() and move ctx acquire into dolog()
- Means we're now taking two different logs when actually logging,
  but since that's the rarer condition it hardly matters.
Free context lock before logging output (and callback)

- Grab the bits we need from context to local variables and free
  the lock before callback and output, either of which could involve
  writing to files (and in case of callback, who knows what) so
  it could take long and prevent something silly like rpmIsDebug() from
  proceeding. Also this way callback can call some rpmlog-related
  functions without much worries of getting stuck or other trouble.
Add a separate mutex for serializing logging events

- Logging output (including callback activities) is conceptually always
  a "write"-event, but independent of log context manipulation so it
  needs a mutex of its own to serialize log events. Previously we
  write-locked only for records that need saving, so messages above
  warning level could get interleaved.
Eliminate redundant argument to formatResult()

- Verification result can only be RPMRC_NOKEY or RPMRC_NOTTRUSTED
  on actual signatures since forever (rpm 4.4.x used to return
  RPMRC_NOKEY for missing digest), this is no longer needed.