Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Saul Wold <sgw@linux.intel.com>
To: Constantin Musca <constantinx.musca@intel.com>
Cc: peachj@lexmark.com, openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] log_srcrev.bbclass: add a bbclass for logging SRCREVs
Date: Mon, 25 Feb 2013 16:31:54 -0800	[thread overview]
Message-ID: <512C027A.4010400@linux.intel.com> (raw)
In-Reply-To: <1361522961-5673-1-git-send-email-constantinx.musca@intel.com>

On 02/22/2013 12:49 AM, Constantin Musca wrote:
> - add a task which creates a file for each package with the following
> format:
>
> BB_FILENAME: ${BB_FILENAME}
> SRC_URI: ${SRC_URI}
> SRCREV: ${SRCREV}
> FROM AUTOREV: no/yes
>
Would it be better to have the format more as a CSV

bbfilename,src_uri,srcrev,autorev?

This would make it easier to parse for scripts

Jerrod, you are the requester on this, do you have any comments on the 
format?


> [YOCTO #3041]
>
> Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
> ---
>   meta/classes/log_srcrev.bbclass | 20 ++++++++++++++++++++
>   1 file changed, 20 insertions(+)
>   create mode 100644 meta/classes/log_srcrev.bbclass
>
> diff --git a/meta/classes/log_srcrev.bbclass b/meta/classes/log_srcrev.bbclass
> new file mode 100644
> index 0000000..b319e7b
> --- /dev/null
> +++ b/meta/classes/log_srcrev.bbclass
> @@ -0,0 +1,20 @@
> +SRCREV_LOGFILE ??= 'srcrev_log'
> +
> +python do_log_srcrev () {
> +    srcrev = d.getVar('SRCREV', True)
> +    if srcrev:
> +        bbfile = d.getVar('BB_FILENAME', True)
> +        src_uri = d.getVar('SRC_URI', True)
> +        from_autorev = 'yes' if d.getVar('SRCREV', False) == 'AUTOINC' else 'no'
> +
> +        srcrevdir = d.expand('${TMPDIR}/srcrevs/${MULTIMACH_TARGET_SYS}/${PN}-${PV}/')
> +        srcrevfile = os.path.join(srcrevdir, d.getVar('SRCREV_LOGFILE', True))
> +        bb.utils.mkdirhier(os.path.dirname(srcrevfile))
> +
Do we really need the extra level of directory here?  Can the data be 
contained in a ${PN}-${PV} file instead?  Also this might be better to 
be ${BP} (base package & version).

You already have the mulitlib info in the ${MULTIMACH_TARGET_SYS} info.


Thanks
	Sau!


> +        with open(srcrevfile, 'w') as f:
> +            f.write("BB_FILENAME: %s\nSRC_URI: %s\nSRCREV: %s\nFROM AUTOREV: %s\n"
> +                    % (bbfile, src_uri, srcrev, from_autorev))
> +}
> +
> +addtask do_log_srcrev after do_fetch
> +do_log_srcrev[cleandirs] = "${TMPDIR}/srcrevs/${MULTIMACH_TARGET_SYS}/${PN}-${PV}/"
>



      reply	other threads:[~2013-02-26  0:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-22  8:49 [PATCH] log_srcrev.bbclass: add a bbclass for logging SRCREVs Constantin Musca
2013-02-26  0:31 ` Saul Wold [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=512C027A.4010400@linux.intel.com \
    --to=sgw@linux.intel.com \
    --cc=constantinx.musca@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=peachj@lexmark.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