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 +++++++++++ UpdateManager/MetaRelease.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) 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 diff --git a/UpdateManager/MetaRelease.py b/UpdateManager/MetaRelease.py index 451c48f0..c5d28212 100644 --- a/UpdateManager/MetaRelease.py +++ b/UpdateManager/MetaRelease.py @@ -100,7 +100,7 @@ class MetaRelease(gobject.GObject): #print name rawdate = index_tag.Section["Date"] date = time.mktime(rfc822.parsedate(rawdate)) - supported = index_tag.Section["Supported"] + supported = bool(index_tag.Section["Supported"]) # add the information to a new date object dist = Dist(name,date,supported) if index_tag.Section.has_key("ReleaseNotes"): -- cgit v1.2.3