summaryrefslogtreecommitdiff
path: root/DistUpgrade/DistUpgradeControler.py
diff options
context:
space:
mode:
Diffstat (limited to 'DistUpgrade/DistUpgradeControler.py')
-rw-r--r--DistUpgrade/DistUpgradeControler.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py
index 0fdb8bbd..b90224a2 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
@@ -262,15 +273,17 @@ class DistUpgradeControler(object):
if not self.askDistUpgrade():
self.abort()
- self._view.updateStatus(_("Performing the upgrade"))
+ self._view.updateStatus(_("Upgrading"))
if not self.doDistUpgrade():
self.abort()
# do post-upgrade stuff
self._view.setStep(4)
+ self._view.updateStatus(_("Searching for obsolete software"))
self.doPostUpgrade()
# done, ask for reboot
+ self._view.updateStatus(_("System upgrade is complete."))
if self.askForReboot():
subprocess.call(["reboot"])