Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
To: Paul Eggleton <paul.eggleton@linux.intel.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH v5] image-buildinfo.bbclass: New class, writes
Date: Wed, 05 Nov 2014 12:10:06 -0600	[thread overview]
Message-ID: <545A67FE.9000504@linux.intel.com> (raw)
In-Reply-To: <3489220.ni93R9xSTH@peggleto-mobl5.ger.corp.intel.com>

Ok, Paul , Imy main reason to list those two was to put an example of 
"list" variables, but with that fix you mention, it won't be needed 
anymore, I agree and I'll rename outputvars and I will move squashspaces 
to oe.utils.


On 05/11/14 12:00, Paul Eggleton wrote:
> Hi Alejandro,
>
> We're getting there, thanks for your patience - just a few more tweaks:
>
> On Tuesday 04 November 2014 12:09:13 Alejandro Hernandez wrote:
>> build information to target filesystem on /etc/build
> Looks like the shortlog has been split over two lines here...
>
>> such as enabled layers, their current status and commit.
>>
>> [YOCTO #6770]
>>
>> Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
>> ---
>>   meta/classes/image-buildinfo.bbclass | 76
>> ++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+)
>>   create mode 100644 meta/classes/image-buildinfo.bbclass
>>
>> diff --git a/meta/classes/image-buildinfo.bbclass
>> b/meta/classes/image-buildinfo.bbclass new file mode 100644
>> index 0000000..d695d24
>> --- /dev/null
>> +++ b/meta/classes/image-buildinfo.bbclass
>> @@ -0,0 +1,76 @@
>> +#
>> +# Writes build information to target filesystem on /etc/build
>> +#
>> +# Copyright (C) 2014 Intel Corporation
>> +# Author: Alejandro Enedino Hernandez Samaniego
>> <alejandro.hernandez@intel.com> +#
>> +# Licensed under the MIT license, see COPYING.MIT for details
>> +#
>> +# Usage: add INHERIT += "image-buildinfo" to your conf file
>> +#
>> +# Desired variables to display
>> +# * If it is a list if values it must be present in both (e.g.
>> IMAGE_FEATURES) +
>> +IMAGE_BUILDINFO_VARS ?= "DISTRO DISTRO_VERSION IMAGE_FEATURES
>> +IMAGE_INSTALL"
> I'm not sure we really want IMAGE_FEATURES and IMAGE_INSTALL in the default
> value; it seems to me at the moment the main usage for this is to help
> determine the version of the build system & metadata that was used.
>
>> +IMAGE_BUILDINFO_LVARS ?= "IMAGE_FEATURES IMAGE_INSTALL"
> I didn't think to use it when I wrote the original implementation, but it
> turns out that at least for both of these two variables, they have a set type
> i.e. from meta/classes/image.bbclass:
>
> IMAGE_INSTALL[type] = "list"
>
> So we could use d.getVarFlag(varname, 'type') to determine the type and then
> we can avoid having to explicitly list them - could you please make this
> change for this version of the function? (Let's leave fixing the buildhistory
> version as a separate exercise for now.)
>
>> +# From buildhistory.bbclass
>> +def squashspaces(string):
>> +    import re
>> +    return re.sub("\s+", " ", string).strip()
> To be honest I had thought squashspaces() would still be moved to oe.utils
> since this function is generic.
>
>> +# From buildhistory.bbclass
>> +def outputvars(vars, listvars, d):
>> +    vars = vars.split()
>> +    listvars = listvars.split()
>> +    ret = ""
>> +    for var in vars:
>> +        value = d.getVar(var, True) or ""
>> +        if var in listvars:
>> +            value = squashspaces(value)
>> +        ret += "%s = %s\n" % (var, value)
>> +    return ret.rstrip('\n')
> I've just realised, if we're inheriting both this class and buildhistory
> globally and these have the same name, that might be a problem. Can we rename
> this version to something lime image_buildinfo_outputvars?
>
> Thanks,
> Paul
>



      reply	other threads:[~2014-11-05 18:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04 18:09 [PATCH v5] image-buildinfo.bbclass: New class, writes Alejandro Hernandez
2014-11-05 18:00 ` Paul Eggleton
2014-11-05 18:10   ` Alejandro Hernandez [this message]

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=545A67FE.9000504@linux.intel.com \
    --to=alejandro.hernandez@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=paul.eggleton@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox