Detect attempts to replace directories and report as conflicts
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 24 Aug 2012 10:02:09 +0000 (13:02 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 24 Aug 2012 10:02:09 +0000 (13:02 +0300)
commit00d82f1322c6dbf471f61bca7a5cc347fc2fca0a
treec0b813573afb56d336ce4565e11878f546bfb122
parent0bbcbb050d3a1d93eafa5ee353d4b89a9946b68f
Detect attempts to replace directories and report as conflicts

- Rpm cannot currently deal with directory changing to something else
  through upgrades. Until now we've barfed up an ugly error in the
  middle of transaction, leaving partially installed broken junk behind.
  It'd sure be nice to be able to actually handle this some day, but
  until then detecting and aborting early is a far better option than
  the former behavior.
- There are some "only in rpm" level bizarre quirks here: packages
  can work around this limitation by using a %pretrans scriptlet,
  which runs before the conflict detection. But this means a possible
  test-transaction (as done by eg yum) will still see the conflicts,
  as we obviously dont want to run disk-modifying scripts on
  test-transaction. So when looking at these removal conflicts, we filter
  them out on test-transaction IFF the package has a %pretrans script
  so there's a chance it might actually fix the conflict when we get
  to it in a real transaction. Obviously %pretrans from any package
  could in theory fix such issues, but as this is evil enough as it is,
  try to limit the damage... Without %pretrans, the only other option
  to get around these is manual intervention.
lib/transaction.c
tests/rpmconflict.at
tests/rpmreplace.at