[PATCH 1/2] Error out on %pre script errors when installing packages (#511801).

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

 



---
 yuminstall.py |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/yuminstall.py b/yuminstall.py
index cb30642..34dafa5 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -229,17 +229,22 @@ class AnacondaCallback:
                 self.initWindow.pulse()
 
         elif what in (rpm.RPMCALLBACK_CPIO_ERROR,
-                      rpm.RPMCALLBACK_UNPACK_ERROR):
+                      rpm.RPMCALLBACK_UNPACK_ERROR,
+                      rpm.RPMCALLBACK_SCRIPT_ERROR):
             (hdr, rpmloc) = h
 
-            self.messageWindow(_("Error Installing Package"),
-                _("A fatal error occurred when installing the %s "
-                  "package.  This could indicate errors when reading "
-                  "the installation media.  Installation cannot "
-                  "continue.") % hdr['name'],
-                type="custom", custom_icon="error",
-                custom_buttons=[_("_Exit installer")])
-            sys.exit(1)
+            # Script errors store whether or not they're fatal in "total".  So,
+            # we should only error out for fatal script errors or the cpio and
+            # unpack problems.
+            if what != rpm.RPMCALLBACK_SCRIPT_ERROR or total:
+                self.messageWindow(_("Error Installing Package"),
+                    _("A fatal error occurred when installing the %s "
+                      "package.  This could indicate errors when reading "
+                      "the installation media.  Installation cannot "
+                      "continue.") % hdr['name'],
+                    type="custom", custom_icon="error",
+                    custom_buttons=[_("_Exit installer")])
+                sys.exit(1)
 
         if self.initWindow is None:
             self.progress.processEvents()
-- 
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