diff options
author | Ján ONDREJ <ondrejj@salstar.sk> | 2008-06-04 06:38:02 +0000 |
---|---|---|
committer | Ján ONDREJ <ondrejj@salstar.sk> | 2008-06-04 06:38:02 +0000 |
commit | 96d7f3e7e678a8ac9919ce628c2f792d4cb57955 (patch) | |
tree | 71d6ba7f9e48f87f90a8f8d5c8937c229913d6c5 /livecd.py | |
parent | e772036e9972589c7808428c9fd00b90b2089a66 (diff) | |
download | anaconda-96d7f3e7e678a8ac9919ce628c2f792d4cb57955.tar.gz anaconda-96d7f3e7e678a8ac9919ce628c2f792d4cb57955.tar.xz anaconda-96d7f3e7e678a8ac9919ce628c2f792d4cb57955.zip |
2008-06-04 Ján ONDREJ <ondrejj@salstar.sk> (via ondrejj@fedoraproject.org)
* po/sk.po: Typo fix.
Diffstat (limited to 'livecd.py')
-rw-r--r-- | livecd.py | 28 |
1 files changed, 24 insertions, 4 deletions
@@ -32,11 +32,12 @@ import subprocess import selinux -from rhpl.translate import _, N_ - from flags import flags from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + import backend import isys import iutil @@ -188,8 +189,27 @@ class LiveCDCopyBackend(backend.AnacondaBackend): size = self._getLiveSize() copied = 0 while copied < size: - buf = os.read(osfd, readamt) - written = os.write(rootfd, buf) + try: + buf = os.read(osfd, readamt) + written = os.write(rootfd, buf) + except: + rc = anaconda.intf.messageWindow(_("Error"), + _("There was an error installing the live image to " + "your hard drive. This could be due to bad media. " + "Please verify your installation media.\n\nIf you " + "exit, your system will be left in an inconsistent " + "state that will require reinstallation."), + type="custom", custom_icon="error", + custom_buttons=[_("_Exit installer"), _("_Retry")]) + + if rc == 0: + sys.exit(0) + else: + os.lseek(osfd, 0, 0) + os.lseek(rootfd, 0, 0) + copied = 0 + continue + if (written < readamt) and (written < len(buf)): raise RuntimeError, "error copying filesystem!" copied += written |