All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: Jason Wessel <jason.wessel@windriver.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] packageinfo.bbclass: Fix crash in hob
Date: Thu, 06 Sep 2012 21:36:31 +0100	[thread overview]
Message-ID: <2236591.qU5F3vlEoV@helios> (raw)
In-Reply-To: <1346957634-22312-1-git-send-email-jason.wessel@windriver.com>

On Thursday 06 September 2012 13:53:54 Jason Wessel wrote:
> The hob internally fails after executing a build and invoking
> the hob a second time when it tries to use the values found in
> BUILDDIR/tmp/pkgdata/*/runtime/*
> 
> The internal failure of the hob will manifest itself as
> stating "Populated recipes 99%" forever after selecting
> a machine just after starting the hob interface.
> 
> The internal trace looks like:
> 
> Traceback (most recent call last):
>   File "packageinfo_handler(e)", line 24, in packageinfo_handler
> KeyError: 'PKGV'
> 
> It is a result of using an override for a package version for
> pieces of the toolchain, in the bb file e.g.
>     PKGV_gdb-dbg = "1234.5678"
> 
> The work around for now is to populate the sdata PKGV value
> and to assign the pkgv variable with the correct value
> from the values found in the pkgdata store.
> 
> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
> ---
>  meta/classes/packageinfo.bbclass |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/meta/classes/packageinfo.bbclass
> b/meta/classes/packageinfo.bbclass index 26cce60..53965e4 100644
> --- a/meta/classes/packageinfo.bbclass
> +++ b/meta/classes/packageinfo.bbclass
> @@ -18,7 +18,12 @@ python packageinfo_handler () {
>                          sdata = oe.packagedata.read_pkgdatafile(root +
> pkgname) sdata['PKG'] = pkgname
>                          pkgrename = sdata['PKG_%s' % pkgname]
> -                        pkgv = sdata['PKGV'].replace('-', '+')
> +                        try:
> +                            pkgv = sdata['PKGV']
> +                        except:
> +			    sdata['PKGV'] = sdata['PKGV_%s' % pkgname]
> +                        pkgv = sdata['PKGV']
> +                        pkgv = pkgv.replace('-', '+')
>                          pkgr = sdata['PKGR']
>                          # We found there are some renaming issue with
> certain architecture. # For example, armv7a-vfp-neon, it will use armv7a in
> the rpm file. This is the workaround for it.

Rather than a blanket try...except which could catch other errors I would 
suggest using .get() to which you can supply a default value if no such key 
exists in the dict.

I'm afraid I didn't get around to determining whether we should be recording 
these package name overrides in the pkgdata files today, I will check into that 
tomorrow.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



  reply	other threads:[~2012-09-06 20:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-06 18:53 [PATCH] packageinfo.bbclass: Fix crash in hob Jason Wessel
2012-09-06 20:36 ` Paul Eggleton [this message]
2012-09-06 20:52   ` Jason Wessel
2012-09-10 13:09     ` Paul Eggleton

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=2236591.qU5F3vlEoV@helios \
    --to=paul.eggleton@linux.intel.com \
    --cc=jason.wessel@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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.