diff options
author | Chris Lumens <clumens@redhat.com> | 2006-09-06 17:49:32 +0000 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2006-09-06 17:49:32 +0000 |
commit | d2e8a32bd2e7146d90106867a12554be50559fbe (patch) | |
tree | a40285996c6f448ebad8e60a935a5dfd24713579 /yuminstall.py | |
parent | b430f2b1d50a4abbd9e5c5f5756692b2f6ead30f (diff) | |
download | anaconda-d2e8a32bd2e7146d90106867a12554be50559fbe.tar.gz anaconda-d2e8a32bd2e7146d90106867a12554be50559fbe.tar.xz anaconda-d2e8a32bd2e7146d90106867a12554be50559fbe.zip |
Iterate over enabled repos, instead of trusting yum to do that for us. This
allows giving the option of skipping incorrect repositories during kickstart
(#204831).
Diffstat (limited to 'yuminstall.py')
-rw-r--r-- | yuminstall.py | 70 |
1 files changed, 42 insertions, 28 deletions
diff --git a/yuminstall.py b/yuminstall.py index 225520284..40174f66b 100644 --- a/yuminstall.py +++ b/yuminstall.py @@ -648,12 +648,18 @@ class YumBackend(AnacondaBackend): def doRepoSetup(self, anaconda, thisrepo = None, fatalerrors = True): + # We want to call ayum.doRepoSetup one repo at a time so we have + # some concept of which repo didn't set up correctly. + repos = [] + # Don't do this if we're going backwards if anaconda.dir == DISPATCH_BACK: return if thisrepo is not None: - repo = self.ayum.repos.getRepo(thisrepo) + repos.append(self.ayum.repos.getRepo(thisrepo)) + else: + repos.extend(self.ayum.repos.listEnabled()) anaconda.method.switchMedia(1) @@ -671,35 +677,43 @@ class YumBackend(AnacondaBackend): for t in longtasks: tot += t[1] - if thisrepo is None: - txt = _("Retrieving installation information...") - else: - txt = _("Retrieving installation information for %s...")%(repo.name) - waitwin = YumProgress(anaconda.intf, txt, tot) - self.ayum.repos.callback = waitwin + for repo in repos: + if repo.name is None: + txt = _("Retrieving installation information...") + else: + txt = _("Retrieving installation information for %s...")%(repo.name) + waitwin = YumProgress(anaconda.intf, txt, tot) + self.ayum.repos.callback = waitwin - try: - for (task, incr) in longtasks: - waitwin.set_incr(incr) - if thisrepo is None: - task(thisrepo = None) - else: + try: + for (task, incr) in longtasks: + waitwin.set_incr(incr) task(thisrepo = repo.id) - waitwin.next_task() - waitwin.pop() - except RepoError, e: - log.error("reading package metadata: %s" %(e,)) - waitwin.pop() - if not fatalerrors: - raise RepoError, e - anaconda.intf.messageWindow(_("Error"), - _("Unable to read package metadata. This may be " - "due to a missing repodata directory. Please " - "ensure that your install tree has been " - "correctly generated. %s" % e), - type="custom", custom_icon="error", - custom_buttons=[_("_Exit")]) - sys.exit(0) + waitwin.next_task() + waitwin.pop() + except RepoError, e: + log.error("reading package metadata: %s" %(e,)) + waitwin.pop() + if not fatalerrors: + raise RepoError, e + + if anaconda.isKickstart: + buttons = [_("_Abort"), _("_Continue")] + else: + buttons = [_("_Abort")] + + rc = anaconda.intf.messageWindow(_("Error"), + _("Unable to read package metadata. This may be " + "due to a missing repodata directory. Please " + "ensure that your install tree has been " + "correctly generated. %s" % e), + type="custom", custom_icon="error", + custom_buttons=buttons) + if rc == 0: + sys.exit(0) + else: + self.ayum.repos.delete(repo.id) + continue self.doGroupSetup() self._catchallCategory() |