aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxin B. John <maxin.john@enea.com>2015-02-16 09:25:02 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-16 09:09:36 +0000
commitf35e9bd7b59c180fe9a3d9177efb57b92d9cd373 (patch)
tree0ba4cad9094c014af9151ca5ee4856df3985cc01
parent27848725316ddae619c1b86f8adc0bfecfadf413 (diff)
downloadbitbake-f35e9bd7b59c180fe9a3d9177efb57b92d9cd373.tar.gz
depexp.py: Fix segfault if DISPLAY is not set
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>
-rw-r--r--lib/bb/ui/depexp.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/bb/ui/depexp.py b/lib/bb/ui/depexp.py
index 0c71a3ebd..240aafc3e 100644
--- a/lib/bb/ui/depexp.py
+++ b/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)