Commit Graph

6 Commits

Author SHA1 Message Date
Allan McRae 24684a616e Display progress bar for disk space checking
Checking disk space needed for a transaction can take a while so add
an informative progress bar.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-12 20:30:11 -06:00
Allan McRae 3f0d98c124 Implement disk space checking
Pull together the work of the previous commits to implement a check
for enough free space before performing an install transaction. Abort
if there is not enough free space with an appropriate pm_errno..

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-12 20:29:59 -06:00
Allan McRae e527699ddd 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>
2010-12-12 20:29:54 -06:00
Allan McRae 695656d252 Add function to match file to mount point
For a given file, determine which mount point it is on or will be
installed to.  Take into account that we might be using an alternative
installation root.

Add additional helper function added to sort mount point list for easier
matching.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-12 20:29:49 -06:00
Allan McRae f4e9deb6d7 Add function for listing system mount points
Add a mount_point_list() function that attempts to portably obtain
a list of system mount points and a struct to hold needed mount point
information.

Abort the transaction if we are unable to determine the mount points.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-12 20:29:43 -06:00
Allan McRae adb10c3ab2 Prototype disk space checking functionality
Very basic prototyping for adding functionality to check free disk
space before performing package installs.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-12 20:29:37 -06:00