All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] log_srcrev.bbclass: add a bbclass for logging SRCREVs
@ 2013-02-26 15:08 Constantin Musca
  2013-02-27  0:15 ` Saul Wold
  0 siblings, 1 reply; 2+ messages in thread
From: Constantin Musca @ 2013-02-26 15:08 UTC (permalink / raw)
  To: openembedded-core

- 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@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
-- 
1.7.11.7




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] log_srcrev.bbclass: add a bbclass for logging SRCREVs
  2013-02-26 15:08 [PATCH v3] log_srcrev.bbclass: add a bbclass for logging SRCREVs Constantin Musca
@ 2013-02-27  0:15 ` Saul Wold
  0 siblings, 0 replies; 2+ messages in thread
From: Saul Wold @ 2013-02-27  0:15 UTC (permalink / raw)
  To: Constantin Musca; +Cc: openembedded-core

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@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!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-27  0:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-26 15:08 [PATCH v3] log_srcrev.bbclass: add a bbclass for logging SRCREVs Constantin Musca
2013-02-27  0:15 ` Saul Wold

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.