bitbake-devel.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
From: Martin Jansa <martin.jansa@gmail.com>
To: bitbake-devel@lists.openembedded.org
Cc: steve@sakoman.com, Richard Purdie <richard.purdie@linuxfoundation.org>
Subject: [2.2][PATCH 2/4] cookerdata: Remove incorrect SystemExit usage
Date: Fri, 10 Mar 2023 21:45:17 +0100	[thread overview]
Message-ID: <20230310204519.706973-2-Martin.Jansa@gmail.com> (raw)
In-Reply-To: <20230310204519.706973-1-Martin.Jansa@gmail.com>

From: Richard Purdie <richard.purdie@linuxfoundation.org>

Calling SystemExit doesn't work well with server/client usage since the string
isn't printed to the right place. Use bb.fatal() instead which prints the right
log output and raises and handled exception which then shows correctly on the
UI.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/cookerdata.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bb/cookerdata.py b/lib/bb/cookerdata.py
index 8a354fed7..3555585c8 100644
--- a/lib/bb/cookerdata.py
+++ b/lib/bb/cookerdata.py
@@ -436,7 +436,7 @@ class CookerDataBuilder(object):
                 msg += (" and bitbake did not find a conf/bblayers.conf file in"
                         " the expected location.\nMaybe you accidentally"
                         " invoked bitbake from the wrong directory?")
-            raise SystemExit(msg)
+            bb.fatal(msg)
 
         if not data.getVar("TOPDIR"):
             data.setVar("TOPDIR", os.path.abspath(os.getcwd()))
-- 
2.39.2



  reply	other threads:[~2023-03-10 20:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 20:45 [2.2][PATCH 1/4] utils: Allow to_boolean to support int values Martin Jansa
2023-03-10 20:45 ` Martin Jansa [this message]
2023-03-10 20:45 ` [2.2][PATCH 3/4] cookerdata: Improve early exception handling Martin Jansa
2023-03-10 20:45 ` [2.2][PATCH 4/4] cookerdata: Drop dubious exception handling code Martin Jansa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230310204519.706973-2-Martin.Jansa@gmail.com \
    --to=martin.jansa@gmail.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=steve@sakoman.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).