summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-01-23 18:55:54 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2006-01-23 18:55:54 +0100
commit39915e9f6f204c2ded4d976621b6a1a37b6c3548 (patch)
tree9d6185a9b1ab9bec7579e369e8c0034c07c06abe
parent166f645a65b1230cfb58f359e3c70c441b9fe09b (diff)
downloadpython-apt-39915e9f6f204c2ded4d976621b6a1a37b6c3548.tar.gz
* added check if the download size fits onto the download partition
-rw-r--r--DistUpgrade/DistUpgradeControler.py11
-rw-r--r--UpdateManager/MetaRelease.py2
2 files changed, 12 insertions, 1 deletions
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"):