summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2009-11-16 10:24:25 -0500
committerChris Lumens <clumens@redhat.com>2009-11-18 13:32:57 -0500
commit10f2b35ca694e088e2b30f8a089043fe43d7bbdf (patch)
treecf0743546ba54df691ab86437dfff7005b9583b5
parentddd3756e29f585a21f04fbbb273650525510da2f (diff)
If a package has a dependency problem, offer to continue/abort (#511801).
This message can be ignored in kickstart by using %packages --ignoremissing.
-rw-r--r--yuminstall.py57
1 files changed, 42 insertions, 15 deletions
diff --git a/yuminstall.py b/yuminstall.py
index 76c7f6446..1712a153b 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -1361,27 +1361,54 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
self.ayum.update()
try:
- while 1:
+ while True:
try:
(code, msgs) = self.ayum.buildTransaction()
+
+ # If %packages --ignoremissing was given, don't bother
+ # prompting for missing dependencies.
+ if anaconda.isKickstart and anaconda.id.ksdata.packages.handleMissing == KS_MISSING_IGNORE:
+ break
+
+ if code == 1 and not anaconda.id.upgrade:
+ # resolveDeps returns 0 if empty transaction, 1 if error,
+ # 2 if success
+ depprob = "\n".join(msgs)
+
+ rc = anaconda.intf.detailedMessageWindow(_("Warning"),
+ _("Some of the packages you have selected for "
+ "install are missing dependencies. You can "
+ "exit the installation, go back and change "
+ "your package selections, or continue "
+ "installing these packages without their "
+ "dependencies."),
+ depprob + "\n", type="custom", custom_icon="error",
+ custom_buttons=[_("_Exit installer"), _("_Back"),
+ _("_Continue")])
+
+ if rc == 0:
+ sys.exit(1)
+ elif rc == 1:
+ self.ayum._undoDepInstalls()
+ return DISPATCH_BACK
+
+ break
except RepoError, e:
- buttons = [_("_Exit installer"), _("_Retry")]
+ # FIXME: would be nice to be able to recover here
+ 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.\n\n%s" % e),
+ type="custom", custom_icon="error",
+ custom_buttons=[_("_Exit installer"), _("_Retry")])
+ if rc == 0:
+ sys.exit(0)
+ else:
+ continue
else:
break
- # FIXME: would be nice to be able to recover here
- 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.\n\n%s" % e),
- type="custom", custom_icon="error",
- custom_buttons=buttons)
- if rc == 0:
- sys.exit(0)
- else:
- continue
-
(self.dlpkgs, self.totalSize, self.totalFiles) = self.ayum.getDownloadPkgs()
if not anaconda.id.getUpgrade():