FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 05-18-2008, 02:53 PM
Chris Lumens
 
Default taking care of some IOErrors

I know it's impossible to predict where all the IOErrors coming from bad
media could happen. However I get the feeling that most are coming from
repo.getPackage in yuminstall.py. With that said, I propose the
following patch:

diff --git a/yuminstall.py b/yuminstall.py
index 9303607..61980e4 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -171,6 +171,15 @@ class AnacondaCallback:

f = open(fn, 'r')
self.openfile = f
+ except IOError, e:
+ if e.errno == 5:
+ self.messageWindow(_("Error"), _("An error occurred "
+ "reading the package %s. This is probably due to "
+ "bad media. Please verify your disc with media "
+ "check. The installer will now exit.") % pkgStr,
+ type="custom", custom_icon="error",
+ custom_buttons=[_("_Exit installer")])
+ sys.exit(1)
except yum.Errors.NoMoreMirrorsRepoError:
self.ayum._handleFailure(po)
except yum.Errors.RepoError, e:

We can tweak the error message a little bit. And we can add this same
block in one or two other places later on if need be. I think this will
probably take care of at least 67% of the IOError tracebacks we're
seeing. Live CD installs can probably also be fixed up with just one or
two of these blocks. Objections?

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 05-19-2008, 02:26 AM
Jeremy Katz
 
Default taking care of some IOErrors

On Sun, 2008-05-18 at 10:53 -0400, Chris Lumens wrote:
> I know it's impossible to predict where all the IOErrors coming from bad
> media could happen. However I get the feeling that most are coming from
> repo.getPackage in yuminstall.py. With that said, I propose the
> following patch:

Honestly, I'd rather have them caught in yum (or even better perhaps --
urlgrabber) and then just have them fall over to the next mirror just
like if there were a timeout on downloading from a URL. We really
shouldn't have to be catching IOError in anaconda here :-/

But in any case, it should probably be falling over to the
_handleFailure handler and not just failing out entirely with a custom
string, etc. Given the crappiness of CD drives, even just a retry could
end up fixing things. Plus, that will then let a user fall over to the
network once we get that hooked up.

Jeremy

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 05-19-2008, 01:48 PM
Chris Lumens
 
Default taking care of some IOErrors

> But in any case, it should probably be falling over to the
> _handleFailure handler and not just failing out entirely with a custom
> string, etc. Given the crappiness of CD drives, even just a retry could
> end up fixing things. Plus, that will then let a user fall over to the
> network once we get that hooked up.

In fact, _handleFailure already has special code for talking about
media, ejecting, and that sort of thing. I probably even wrote it too.
If only I could remember doing that sort of thing.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 10:22 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org