diff options
author | Chris Lumens <clumens@redhat.com> | 2006-04-27 17:15:52 +0000 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2006-04-27 17:15:52 +0000 |
commit | 87d1d2f59928f0fbb7bcc81f9327ff29f45268b6 (patch) | |
tree | f7ade1b50c8459575aa8be8ae6d7e58131a39cce | |
parent | 676d1f2cd7fa8aa2fb44b70e5ea5babc9e807801 (diff) | |
download | anaconda-87d1d2f59928f0fbb7bcc81f9327ff29f45268b6.tar.gz anaconda-87d1d2f59928f0fbb7bcc81f9327ff29f45268b6.tar.xz anaconda-87d1d2f59928f0fbb7bcc81f9327ff29f45268b6.zip |
Warn if there's not enough space for an upgrade (#189022).
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | yuminstall.py | 29 |
2 files changed, 31 insertions, 3 deletions
@@ -1,3 +1,8 @@ +2006-04-27 Chris Lumens <clumens@redhat.com> + + * yuminstall.py (AnacondaYum._run): Warn if there's not enough space + for an upgrade (#189022). + 2006-04-26 Jeremy Katz <katzj@redhat.com> * network.py (Network.__init__): Don't reconfig network if using diff --git a/yuminstall.py b/yuminstall.py index 368809a86..34f0eba7a 100644 --- a/yuminstall.py +++ b/yuminstall.py @@ -496,6 +496,8 @@ class AnacondaYum(YumSorter): self.ts.ts.scriptFd = instLog.fileno() rpm.setLogFile(instLog) + spaceneeded = {} + try: self.runTransaction(cb=cb) except YumBaseError, probs: @@ -515,13 +517,35 @@ class AnacondaYum(YumSorter): for (descr, (type, mount, need)) in probs: if not uniqueProbs.has_key(type) and probTypes.has_key(type): uniqueProbs[type] = probTypes[type] + + if type == rpm.RPMPROB_DISKSPACE: + spaceneeded[mount] = need + log.error("error running transaction: %s" %(descr,)) - probString = ', '.join(uniqueProbs.values()) + if spaceneeded: + spaceprob = _("You need more space on the following " + "file systems:\n") + + for (mount, need) in spaceneeded.items(): + log.info("(%s, %s)" %(mount, need)) + + if mount.startswith("/mnt/sysimage/"): + mount.replace("/mnt/sysimage", "") + elif mount.startswith("/mnt/sysimage"): + mount = "/" + mount.replace("/mnt/sysimage", "") + + spaceprob = spaceprob + "%d M on %s\n" % (need / (1024*1024), mount) + else: + spaceprob = "" + + probString = ', '.join(uniqueProbs.values()) + "\n\n" + spaceprob intf.messageWindow(_("Error running transaction"), ("There was an error running your transaction, " "for the following reason(s): " - "%s " % (probString,))) + "%s " % (probString,)), + type="custom", custom_icon="error", + custom_buttons=[_("Re_boot")]) sys.exit(1) def doCacheSetup(self): @@ -842,7 +866,6 @@ class YumBackend(AnacondaBackend): (code, msgs) = self.ayum.buildTransaction() (self.dlpkgs, self.totalSize, self.totalFiles) = self.ayum.getDownloadPkgs() - # FIXME: Disable check on upgrades for now, fix for FC6. if not id.getUpgrade(): usrPart = id.partitions.getRequestByMountPoint("/usr") if usrPart is not None: |