From b427750a5d8e2a2e1a675f68dea250eb25e94c8e Mon Sep 17 00:00:00 2001 From: "Maxin B. John" Date: Mon, 16 Feb 2015 09:25:02 +0100 Subject: bitbake: depexp.py: Fix segfault if DISPLAY is not set bitbake -g -u depexp segfaults when DISPLAY is not set properly. Fix it with a proper check. [YOCTO #7299] (Bitbake rev: f35e9bd7b59c180fe9a3d9177efb57b92d9cd373) Signed-off-by: Maxin B. John Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/depexp.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bitbake/lib/bb/ui') diff --git a/bitbake/lib/bb/ui/depexp.py b/bitbake/lib/bb/ui/depexp.py index 0c71a3ebd2..240aafc3e7 100644 --- a/bitbake/lib/bb/ui/depexp.py +++ b/bitbake/lib/bb/ui/depexp.py @@ -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) -- cgit v1.2.3-54-g00ecf