[jhbuild] systeminstall: Show a "nice" message if some libraries are missing



commit 8b13df5af81d366a53837e7825eca77c557f3c63
Author: Jonh Wendell <jonh wendell redhat com>
Date:   Wed Apr 26 15:07:25 2017 -0300

    systeminstall: Show a "nice" message if some libraries are missing
    
    Instead of relying on the default python's stack trace.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=778912

 jhbuild/utils/systeminstall.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/jhbuild/utils/systeminstall.py b/jhbuild/utils/systeminstall.py
index a7541ed..1c53b10 100644
--- a/jhbuild/utils/systeminstall.py
+++ b/jhbuild/utils/systeminstall.py
@@ -251,10 +251,16 @@ class PKSystemInstall(SystemInstall):
 
     def _get_new_transaction(self):
         if self._loop is None:
-            import glib
+            try:
+                import glib
+            except:
+                raise SystemExit(_('Error: python-gobject package not found.'))
             self._loop = glib.MainLoop()
         if self._sysbus is None:
-            import dbus.glib
+            try:
+                import dbus.glib
+            except:
+                raise SystemExit(_('Error: dbus-python package not found.'))
             import dbus
             self._dbus = dbus
             self._sysbus = dbus.SystemBus()


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