summaryrefslogtreecommitdiff
path: root/lib/libalpm/diskspace.h
AgeCommit message (Collapse)Author
2011-02-08Skip diskspace checking for symlinks and directories in all casesDan McGee
We did this in some but not all cases, assuming the 0 value coming out of libarchive would not be a problem. However, this does not work for "fake" filesystems such as rpc_pipefs, which reports a free block and total block count of zero. Fix this by not ever counting symlinks or directories, and adding a note explaining that if we someday do count directories, their size needs to be attributed to the proper place. This patch also includes a few cleanups/performance tweaks- avoid calling strlen() on the mountpoint directory string as much by storing this size in our mountpoint struct, and push the snprintf() call up to the calculate functions since we were already doing it here in the remove case. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-07Update copyright years for 2011Allan McRae
Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-12diskspace style cleanups and small fixesDan McGee
* Use our normal return() function syntax * Rework a few things to reduce number of casts * Fix void function argument declaration * Add missing gettext _() call * Remove need for seperate malloc() of statvfs/statfs structure * Unify argument order of static functions- mountpoints now always passed first * Count all files that start with '.' in a package against the DB * Rename db to db_local in check_diskspace to clarify some code * Fix some line wrapping to respect 80 characters Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2010-12-12Refactor statfs/statvfs type checkDan McGee
Turn it into a configure-type typedef, which allows us to reduce the amount of duplicated code and clean up some #ifdef magic in the code itself. Adjust some of the other defined checks to look at the headers available rather than trying to pull in the right ones based on configure checks. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2010-12-12Add function for listing system mount pointsAllan McRae
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-12Prototype disk space checking functionalityAllan McRae
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>