[PATCH 2/2] Let the user abort or continue on missing deps (#511801).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Instead of just continuing with the install and providing the user with
no information about what problems there could be, show what the missing
deps are and provide a choice.  The user can go back, abort the install,
or continue on like anaconda's always done.

On upgrades, we unconditionally use the older behavior, since upgrades
could involve packages from user repos that need to be rebuilt or other
third party packages.
---
 yuminstall.py |   52 +++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 37 insertions(+), 15 deletions(-)

diff --git a/yuminstall.py b/yuminstall.py
index 34dafa5..e92aced 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -1366,27 +1366,49 @@ 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 code == 1 and not anaconda.id.upgrade:
+                        # resolveDeps returns 0 if empty transaction, 1 if error,
+                        # 2 if success
+                        depprob = msgs.join("\n")
+
+                        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
+                        else:
+                            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():
-- 
1.6.5.rc2

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

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux