All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
To: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>,
	 bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH] cookerdata: print an error if layer dir does not exist
Date: Wed, 25 May 2016 12:04:47 +0300	[thread overview]
Message-ID: <1464167087.941.8.camel@linux.intel.com> (raw)
In-Reply-To: <35bff996-f13e-f7d3-4a85-ec710cbc61f8@linux.intel.com>

Hi Leonardo,

On Tue, 2016-05-24 at 09:09 -0500, Leonardo Sandoval wrote:
> 
> On 05/24/2016 02:25 AM, Markus Lehtonen wrote:
> > Makes it easier for user to identify problems, e.g. typos, in
> > BBLAYERS.
> > 
> > [YOCTO #9507]
> > 
> > Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
> > ---
> >   lib/bb/cookerdata.py | 4 ++++
> >   1 file changed, 4 insertions(+)
> > 
> > diff --git a/lib/bb/cookerdata.py b/lib/bb/cookerdata.py
> > index 1615db5..7dfe7b5 100644
> > --- a/lib/bb/cookerdata.py
> > +++ b/lib/bb/cookerdata.py
> > @@ -292,6 +292,10 @@ class CookerDataBuilder(object):
> >               data = bb.data.createCopy(data)
> >               approved = bb.utils.approved_variables()
> >               for layer in layers:
> > +                if not os.path.isdir(layer):
> > +                    parselog.critical("Layer directory '%s' does
> > not to exist! "
> > +                                      "Please check BBLAYERS in
> > %s" % (layer, layerconf))
> > +                    sys.exit(1)
> 
> Markus, I am not familiar with this code, but instead of a
> sys.exit(1), 
> would it be better to raise a exception instead (raise
> SystemExit(msg))?
> 
> >                   parselog.debug(2, "Adding layer %s", layer)
> >                   if 'HOME' in approved and '~' in layer:
> >                       layer = os.path.expanduser(layer)
> 

The reason for this is that with SystemExit() the output will be much
uglier. Bitbake will not only print the error message but also all
logging debug messages and I think that this may confuse the user. The
output would look something like:
--- SNIP -----------------------------------------------------
Layer directory '#' does not to exist! Please check BBLAYERS in
/home/marquiz/yocto/openembedded-core/build-9507/conf/bblayers.conf
DEBUG: Removed the following variables from the environment: _,
LS_COLORS, EMAIL, JAVA_ROOT, LESS, G_BROKEN_FILENAMES, MINICOM,
CSHEDIT, HOSTTYPE, LESSOPEN, QT_SYSTEM_DIR, PYTHONSTARTUP, CVS_RSH,
GPG_AGENT_INFO, INPUTRC, XDG_VTNR, SOCKS_PROXY, CPU, QT_IM_SWITCHER,
XSESSION_IS_UP, AUDIODRIVER, LESSKEY, XDG_DATA_DIRS, XNLSPATH,
TERMINATOR_UUID, ALSA_CONFIG_PATH, HISTSIZE, SDL_AUDIODRIVER, WINDOWID,
LESS_ADVANCED_PREPROCESSOR, gopher_proxy, MANPATH, XMODIFIERS,
WINDOWPATH, JAVA_HOME, PROFILEREAD, XKEYSYMDB, VDPAU_DRIVER,
GIT_CEILING_DIRECTORIES, JAVA_BINDIR, XDG_RUNTIME_DIR, DISPLAY,
PYTHONPATH, COMP_WORDBREAKS, NNTPSERVER, XCURSOR_THEME,
DBUS_SESSION_BUS_PID, G_FILENAME_ENCODING, OSTYPE, HOST, FROM_HEADER,
LESSCLOSE, JRE_HOME, socks_proxy, LS_OPTIONS, GPG_TTY, XDG_SESSION_ID,
DBUS_SESSION_BUS_ADDRESS, ORBIT_SOCKETDIR, LANG, GTK_IM_MODULE,
CONFIG_SITE, XDG_CONFIG_DIRS, GTK_MODULES, SOCKS5_SERVER, XDG_SEAT,
OLDPWD, HOSTNAME, WINDOWMANAGER, INPUT_METHOD, SHLVL, QT_IM_MODULE,
COLORTERM, BUILDDIR, QEMU_AUDIO_DRV, MAIL, MACHTYPE, PAGER,
XAUTHLOCALHOSTNAME, MORE
DEBUG: Found bblayers.conf (/home/marquiz/yocto/openembedded-core/build
-9507/conf/bblayers.conf)
DEBUG: Adding layer /home/marquiz/yocto/openembedded-core/meta
--- SNIP -----------------------------------------------------


The reason for this behavior is that bitbake will spit out all log messages (even debug messages) if it exits at this early stage and there are no non-debug messages in the logger.


Thanks,
  Markus





  reply	other threads:[~2016-05-25  9:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-24  7:25 [PATCH] cookerdata: print an error if layer dir does not exist Markus Lehtonen
2016-05-24 14:09 ` Leonardo Sandoval
2016-05-25  9:04   ` Markus Lehtonen [this message]
2016-05-25  9:57 ` Peter Kjellerstedt

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=1464167087.941.8.camel@linux.intel.com \
    --to=markus.lehtonen@linux.intel.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=leonardo.sandoval.gonzalez@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.