From 39915e9f6f204c2ded4d976621b6a1a37b6c3548 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 23 Jan 2006 18:55:54 +0100 Subject: * added check if the download size fits onto the download partition --- DistUpgrade/DistUpgradeControler.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'DistUpgrade') diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index bea1e40f..6689b4d0 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -27,6 +27,7 @@ import os import subprocess import logging import re +import statvfs from UpdateManager.Common.SimpleGladeApp import SimpleGladeApp from SoftwareProperties.aptsources import SourcesList, SourceEntry @@ -167,6 +168,16 @@ class DistUpgradeControler(object): # log the changes for debuging self._logChanges() # ask the user if he wants to do the changes + archivedir = apt_pkg.Config.FindDir("Dir::Cache::archives ") + st = os.statvfs(archivedir) + free = st[statvfs.F_BAVAIL]*st[statvfs.F_FRSIZE] + if self.cache.requiredDownload > free: + self._view.error(_("Not enough free space"), + _("There is not enough free space on your " + "system to download the required pacakges. " + "Please free some space before trying again " + "with e.g. 'sudo apt-get clean'")) + return False res = self._view.confirmChanges(_("Perform Upgrade?"),changes, self.cache.requiredDownload) return res -- cgit v1.2.3