]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
depexp.py: Fix segfault if DISPLAY is not set
authorMaxin B. John <maxin.john@enea.com>
Mon, 16 Feb 2015 08:25:02 +0000 (09:25 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 16 Feb 2015 09:09:36 +0000 (09:09 +0000)
bitbake -g -u depexp <package> segfaults when DISPLAY is not set
properly. Fix it with a proper check.

[YOCTO #7299]

Signed-off-by: Maxin B. John <maxin.john@enea.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/ui/depexp.py

index 0c71a3ebd206df7400bec6e090f519e5de73c202..240aafc3e74ccb4e35ee69318359705d57b720a9 100644 (file)
@@ -17,6 +17,7 @@
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
+import sys
 import gobject
 import gtk
 import Queue
@@ -215,6 +216,12 @@ def main(server, eventHandler, params):
         print("XMLRPC Fault getting commandline:\n %s" % x)
         return
 
+    try:
+        gtk.init_check()
+    except RuntimeError:
+        sys.stderr.write("Please set DISPLAY variable before running this command \n")
+        return
+
     shutdown = 0
 
     gtkgui = gtkthread(shutdown)