[OE-core] [PATCH v3] log_srcrev.bbclass: add a bbclass for logging SRCREVs

Saul Wold sgw at linux.intel.com
Wed Feb 27 00:15:12 UTC 2013


On 02/26/2013 07:08 AM, Constantin Musca wrote:
> - add a task which creates a file for each package with the following
> format:
>
> ${BB_FILENAME},${SRC_URI},${SRCREV},${FROM_AUTOREV}
>
> [YOCTO #3041]
>
> Signed-off-by: Constantin Musca <constantinx.musca at intel.com>
> ---
>   meta/classes/log_srcrev.bbclass | 15 +++++++++++++++
>   1 file changed, 15 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..a04702c
> --- /dev/null
> +++ b/meta/classes/log_srcrev.bbclass
> @@ -0,0 +1,15 @@
> +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'
> +
> +        srcrevfile = d.expand('${TMPDIR}/srcrevs/${MULTIMACH_TARGET_SYS}/${BP}')
> +        bb.utils.mkdirhier(os.path.dirname(srcrevfile))
> +
> +        with open(srcrevfile, 'w') as f:
> +            f.write(','.join([bbfile, src_uri, srcrev, from_autorev]))
> +}
> +
> +addtask do_log_srcrev after do_fetch
>

Otavio makes a good point, this might be something to consider putting 
it in to the RecipeInfo in buildhistory.bbclass and extend the 
write_pkghistory(), but maybe write the file with a different name 
latest_srcrev

Sau!





More information about the Openembedded-core mailing list