From 30f338cce6ebcab5dc521f5effef4c6527e8a197 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 11 Feb 2011 10:49:30 -0600 Subject: diskspace: allow used flag to be toggled for both remove and install Turn it into an enum rather than a boolean, and use a bitmask like we do for reading DB entries. The relevant flag is turned on in our two calculate loops, and anything reading the used flag later can decided which flag (or either) is relevant. This will allow the read-only partition code to be triggered on a remove-only operation, e.g. if /boot was read-only and one tried to remove grub in a sync transaction. Of course, right now, we don't actually run the diskspace check code in the '-R' codepath. Signed-off-by: Dan McGee --- lib/libalpm/diskspace.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/diskspace.h') diff --git a/lib/libalpm/diskspace.h b/lib/libalpm/diskspace.h index 7c7dcebd..2894a0c2 100644 --- a/lib/libalpm/diskspace.h +++ b/lib/libalpm/diskspace.h @@ -29,6 +29,11 @@ #include "alpm.h" +enum mount_used_level { + USED_REMOVE = 1, + USED_INSTALL = (1 << 1), +}; + typedef struct __alpm_mountpoint_t { /* mount point information */ char *mount_dir; @@ -36,7 +41,7 @@ typedef struct __alpm_mountpoint_t { /* storage for additional disk usage calculations */ long blocks_needed; long max_blocks_needed; - int used; + enum mount_used_level used; int read_only; FSSTATSTYPE fsp; } alpm_mountpoint_t; -- cgit v1.2.3-24-g4f1b