[PATCH 20/21] Take configured filesystems into account when checking package space.

David Lehman dlehman at redhat.com
Thu Aug 9 19:28:39 UTC 2012


---
 pyanaconda/ui/gui/spokes/storage.py |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 3eb7bc1..0081705 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -516,8 +516,23 @@ class StorageSpoke(NormalSpoke, StorageChecker):
                                                clearPartType=CLEARPART_TYPE_ALL)
         disk_free = sum([f[0] for f in free_space.itervalues()])
         fs_free = sum([f[1] for f in free_space.itervalues()])
+
+        # add in total size of new filesystems
+        new_free_mb = 0
+        for mountpoint, device in self.storage.mountpoints.items():
+            if mountpoint != "/" and not mountpoint.startswith("/usr") and \
+               not mountpoint.startswith("/var"):
+                # only count system mounts
+                continue
+
+            if device.format.exists:
+                new_free_mb += getattr(device.format, "free", 0)
+            else:
+                new_free_mb += device.size
+        new_free = Size(spec="%f MB" % new_free_mb)
+
         required_space = self.payload.spaceRequired
-        if disk_free >= required_space:
+        if disk_free + new_free >= required_space:
             dialog = InstallOptions1Dialog(self.data)
         elif sum([d.size for d in disks]) >= required_space:
             dialog = InstallOptions2Dialog(self.data)
-- 
1.7.7.6



More information about the anaconda-patches mailing list