diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-01-23 18:55:54 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-01-23 18:55:54 +0100 |
| commit | 39915e9f6f204c2ded4d976621b6a1a37b6c3548 (patch) | |
| tree | 9d6185a9b1ab9bec7579e369e8c0034c07c06abe /DistUpgrade/DistUpgradeControler.py | |
| parent | 166f645a65b1230cfb58f359e3c70c441b9fe09b (diff) | |
| download | python-apt-39915e9f6f204c2ded4d976621b6a1a37b6c3548.tar.gz | |
* added check if the download size fits onto the download partition
Diffstat (limited to 'DistUpgrade/DistUpgradeControler.py')
| -rw-r--r-- | DistUpgrade/DistUpgradeControler.py | 11 |
1 files changed, 11 insertions, 0 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 |
