summaryrefslogtreecommitdiffstats
path: root/livecd.py
diff options
context:
space:
mode:
authorJán ONDREJ <ondrejj@salstar.sk>2008-06-04 06:38:02 +0000
committerJán ONDREJ <ondrejj@salstar.sk>2008-06-04 06:38:02 +0000
commit96d7f3e7e678a8ac9919ce628c2f792d4cb57955 (patch)
tree71d6ba7f9e48f87f90a8f8d5c8937c229913d6c5 /livecd.py
parente772036e9972589c7808428c9fd00b90b2089a66 (diff)
downloadanaconda-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.py28
1 files changed, 24 insertions, 4 deletions
diff --git a/livecd.py b/livecd.py
index b99b0fffa..58c66ca0f 100644
--- a/livecd.py
+++ b/livecd.py
@@ -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