Add functions to calculate approximate disk usage by packages
commite527699dddca41e3af6c1872e851405a4f5212a0
authorAllan McRae <allan@archlinux.org>
Tue, 16 Nov 2010 06:30:33 +0000 (16 16:30 +1000)
committerDan McGee <dan@archlinux.org>
Mon, 13 Dec 2010 02:29:54 +0000 (12 20:29 -0600)
tree06d8af93ba766f99ab386f9d168289a4f7ca5846
parent695656d25279342f80c307035721ced6d37ee08b
Add functions to calculate approximate disk usage by packages

Two helper function are added to calculate the disk usage from packages
that are either currently installed on the system or from a package
archive.

Some minor approximations have been made:

1. Size for directories is not considered when removing a package from the
   filesystem to avoid multiple counting across packages. Also, these are
   reported to take zero size while installing.

2. Symlinks are reported to contribute zero size towards removal as
   libarchive reports them to have zero size for install.

3. Package data files (.PKGINFO, .INSTALL, .CHANGELOG) are counted towards
   usage on dbpath on install, but their size is not counted on package
   removal.

4. No handling of extra size needed for .pacsave/.pacnew files.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
configure.ac
lib/libalpm/diskspace.c