Throw an exception from Fseek() errors in python rpmfd.seek()
(cherry picked from commit d69ebf18f100193305c5a49c7ac5c26978db67d2)
Make peace with autoconf-2.68
(cherry picked from commit 584b9d4f5a5def7af56ba81899b23178cae0a913)
Preferred color pkgs should be erased last
- On install we need to queue preferred colored pkgs before others
  to account for the way colored files get laid on disk. On erase,
  we need to revert this for the same reason. Most of the time
  dependencies take care of this, but the queue placement matters in
  cases such as RhBug:680261 where the order is not dependency-driven.
(cherry picked from commit 4a16d55f1f689ab06e8dd45c50b86e478a732367)
Improve the dependency loop debug message a bit
- Fix one-off in the SCC numbering
- Fix wording to talk about number of external dependencies, not packages
- Show number of members in the SCC
(cherry picked from commit fa7b4dbb4eee39ca9cc06b22438efd41e243e72c)
Take file state into account for file dependencies
- Files which are not installed, have been replaced or are of wrong
  color can not actually satisfy a dependency despite what the package's
  file list says.
- This prevents breaking the system despite seemingly correct dependencies
  in some situations, such as on multilib systems where a colored
  files can appear to be shared between primary and secondary architecture
  packages, but only the file from primary arch package is physically
  present, and removing the primary arch package would remove the
  file and silently break any dependencies on such files in practise.
  Similarly replaced files become owned by the replacing package in
  practise, so the original package whose files were replaced can no
  longer satisfy dependency on those files.
(cherry picked from commit 566a15c9c08aa593d05e2f55f1c171a48bc1b1bc)
Verify some properties of replaced and wrong-colored files (RhBug:528383)
- We can't verify any properties of replaced files, but we can and
  should still see if it exists at all.
- Files skipped due to wrong color are supposed to share some of
  the attributes with the file that got actually installed, such
  as permissions and whether it exists at all. Verify what we can
  instead of silently ignoring.
(cherry picked from commit ee0ae58b442c5f79967a0d0580144b5c84e0c888)
Python 3 fixups
- PyString is gone, use PyBytes instead
- Add compatibility defines to paper over
  PyInt/PyLong_JustHowLongFunctionNamesYouCanComeUpWith()
(cherry picked from commit cb61d8a89c70c1771947c10984eeab2141133bd4)
Fix the PyBytes vs PyString compatibility defines
- Oops. Quite obviously nobody has even tried to build this with
  python < 2.6. Whether it'd actually work is another question...
(cherry picked from commit ba38b2551f51538885df60b849906de005fb78ed)
Fix whitespace in Python doc string
(cherry picked from commit e6d66aab71b0f9345a6ad49e6b522ac788fd6f28)
Update librpm doxygen module list
- rpmgi is gone, rpmprob is a "new" item
(cherry picked from commit 01fc1efc3ce2e806acf02814313d3535de7908b9)
Avoid freeing an unallocated variable (RhBug:688091)
(cherry picked from commit 88a3950fd8ccee544b23d0eb15d2f1a9faa1d2a3)
Missing va_end() call
(cherry picked from commit 5caa0a5191923602e4f4942a01daf6832ee0bb46)
Plug memory leaks on macro definition error cases
(cherry picked from commit 1817ac020ea58f03b038cf1bdca001d9683e2604)
Fix a small memleak in rpmsign tool
(cherry picked from commit f974288ea14d71bfa38c415745b723190c2aee15)
Fix classification of ELF binaries with sticky bit (RhBug:689182)
(cherry picked from commit 6eba5dc468aa2d26ff80f9321e8d4d014279d506)
Use pkg-config to find Lua + determine flags (ticket #88)
- Additionally clean up the logic a bit and dont bother building
  any lua-related bits if disabled
(cherry picked from commit f825911b73db44d1b2455a0495d2450dd0865402)
Add a more useful example to rpm2cpio manpage
- Based on suggestions from Masatake Yamato and others from rpm-list
(cherry picked from commit e11575180fb7af43211747aa0c855f131de255e9)
Dont reference transaction set from transaction elements
- Elements referencing ts prevents rpmtsFree() from freeing anything
  unless the caller does rpmtsEmpty() first. Oops. Undo the braindamage
  from commit 8f7c2d7063df6d1057425d014ce4168d46c5e7d9.
(cherry picked from commit 077d2c850cf0a719d7abacc3256168d60a4ec7bb)
Honor $TMPDIR in various scripts.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit 6331fec6e4be0c96517d37cbfbf8f2b1b2a8ad24)
Fix dangling databases from iterators (ticket #820)
- Call rpmdbClose() instead of rpmdbUnlink() on iterator free to
  actually close the db when refcount goes to zero. This
  fixes the situation where a caller closes a database handle
  while iterators are active: the iterators stay usable and close
  the db when the last one exits.
(cherry picked from commit 3544062a6ed8f165eb773766ed5540b96f1bcc03)