diff options
-rw-r--r-- | image.py | 17 | ||||
-rw-r--r-- | iutil.py | 28 | ||||
-rw-r--r-- | todo.py | 16 |
3 files changed, 43 insertions, 18 deletions
@@ -39,10 +39,19 @@ class CdromInstallMethod(ImageInstallMethod): self.loopbackFile = mntPoint + fstab.filesystemSpace()[0][0] + \ "/rhinstall-stage2.img" - iutil.copyFile("%s/RedHat/base/stage2.img" % self.tree, - self.loopbackFile, - (self.progressWindow, _("Copying File"), - _("Transferring install image to hard drive..."))) + try: + iutil.copyFile("%s/RedHat/base/stage2.img" % self.tree, + self.loopbackFile, + (self.progressWindow, _("Copying File"), + _("Transferring install image to hard drive..."))) + except: + self.messageWindow(_("Error"), + _("An error occured transferring the install image " + "to your hard drive. You are probably out of disk " + "space.")) + os.unlink(self.loopbackFile) + return 1 + isys.makeDevInode("loop0", "/tmp/loop") isys.lochangefd("/tmp/loop", self.loopbackFile) @@ -138,20 +138,22 @@ def copyFile(source, to, pw = None): total = os.path.getsize(source) win = fn(title, text, total) - count = os.read(f, 262144) - total = 0 - while (count): - os.write(t, count) - total = total + len(count) - if pw: - win.set(total) - count = os.read(f, 16384) - - os.close(f) - os.close(t) + try: + count = os.read(f, 262144) + total = 0 + while (count): + os.write(t, count) + + total = total + len(count) + if pw: + win.set(total) + count = os.read(f, 16384) + finally: + os.close(f) + os.close(t) - if pw: - win.pop() + if pw: + win.pop() def memInstalled(): f = open("/proc/meminfo", "r") @@ -1300,6 +1300,12 @@ class ToDo: self.hdList['kernel-smp'][rpm.RPMTAG_RELEASE] + "smp") kernelVersions.append(version) + if (self.hdList.has_key('kernel-enterprise') and + self.hdList['kernel-enterprise'].selected): + version = (self.hdList['kernel-enterprise'][rpm.RPMTAG_VERSION] + "-" + + self.hdList['kernel-enterprise'][rpm.RPMTAG_RELEASE] + "smp") + kernelVersions.append(version) + version = (self.hdList['kernel'][rpm.RPMTAG_VERSION] + "-" + self.hdList['kernel'][rpm.RPMTAG_RELEASE]) kernelVersions.append(version) @@ -1337,6 +1343,12 @@ class ToDo: self.hdList['kernel-smp'][rpm.RPMTAG_RELEASE] + "smp") kernelVersions.append(version) + if (self.hdList.has_key('kernel-enterprise') and + self.hdList['kernel-enterprise'].selected): + version = (self.hdList['kernel-enterprise'][rpm.RPMTAG_VERSION] + "-" + + self.hdList['kernel-enterprise'][rpm.RPMTAG_RELEASE] + "smp") + kernelVersions.append(version) + version = (self.hdList['kernel'][rpm.RPMTAG_VERSION] + "-" + self.hdList['kernel'][rpm.RPMTAG_RELEASE]) kernelVersions.append(version) @@ -1449,7 +1461,9 @@ class ToDo: f = open(self.instPath + "/etc/mtab", "w+") f.close() - self.method.systemMounted (self.fstab, self.instPath, self.hdList.selected()) + if self.method.systemMounted (self.fstab, self.instPath, self.hdList.selected()): + self.fstab.umountFilesystems(self.instPath) + return 1 if not self.installSystem: return |