Return-Path: Received: from mx-3.enea.com (sestofw01.enea.se [192.36.1.252]) by mail.openembedded.org (Postfix) with SMTP id E5ED7606E9 for ; Mon, 9 Feb 2015 11:37:36 +0000 (UTC) Received: from maxin-HP-EliteBook-Folio-9470m.enea.se (172.16.141.163) by smtp.enea.com (172.21.1.209) with Microsoft SMTP Server id 14.3.224.2; Mon, 9 Feb 2015 12:37:31 +0100 From: "Maxin B. John" To: Date: Mon, 9 Feb 2015 12:37:29 +0100 Message-ID: <1423481849-5774-1-git-send-email-maxin.john@enea.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Received-SPF: None (SESTOEX03.enea.se: maxin.john@enea.com does not designate permitted sender hosts) Subject: [PATCH] depexp.py: Fix segfault if DISPLAY is not set X-BeenThere: bitbake-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussion that advance bitbake development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2015 11:37:46 -0000 Content-Type: text/plain bitbake -g -u depexp segfaults when DISPLAY is not set properly. Fix it with a proper check. [YOCTO #7299] Signed-off-by: Maxin B. John --- bitbake/lib/bb/ui/depexp.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bitbake/lib/bb/ui/depexp.py b/bitbake/lib/bb/ui/depexp.py index 0c71a3e..9f1701f 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: + print "Please set DISPLAY variable before running this command." + sys.exit(1) + shutdown = 0 gtkgui = gtkthread(shutdown) -- 1.9.1