Account for temporary disk-space requirements on updates (ticket #175)
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 14 Nov 2012 08:31:15 +0000 (10:31 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 14 Nov 2012 10:38:07 +0000 (12:38 +0200)
commitbda49fd7bdb4eaa1fa4d42c04efc28c7a0a78473
tree06d62cd0bef368e6a46a72e27281cef1871db4e4
parenta4dd60f7fb599646689ca3d92acce129a8591dba
Account for temporary disk-space requirements on updates (ticket #175)

- When updating packages, we first create them with a temporary names
  and only after all files from payload have been created this way,
  the files are renamed to the final target. This means that performing
  an update temporarily requires roughly twice the disk space (and inodes)
  compared to the final result on per-package level. Which matters
  when space is tight, such as presumably in RhBug:872314.
- Simulate what happens on upgrades by adding block and inode delta
  to the equation: installing a file always consumes an inode and
  the specified amount of disk space. But when replacing files,
  reduce the size-delta from disk consumption *after* checking for
  problems in a given DSI.
- Also fixes inode accounting which has been broken for forever (since
  commit a9a1fd866c573f41287e6ad256ce64b3970a1eaa more exactly)
(cherry picked from commit 85df102165fdbe64978f2019d757d400e7448218)
lib/transaction.c