Skip to contentSkip to conversation

log_srcrev.bbclass: add a bbclass for logging SRCREVs

PATCH Superseded Constantin Musca 3 participants 4 messages Feb 26, 2013

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 log_srcrev.bbclass: add a bbclass for logging SRCREVs

- add a task which creates a file for each package with the following format:

${BB_FILENAME},${SRC_URI},${SRCREV},${FROM_AUTOREV}

[YOCTO #3041]

---
 meta/classes/log_srcrev.bbclass | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 meta/classes/log_srcrev.bbclass
meta/classes/log_srcrev.bbclass new file +15 -0
new file mode 100644
index 0000000..d5d0284
@@ -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}-${PV}')
+        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
Signature · 1 line
1.7.11.7
#1 lore raw
Quoted 8 lines · Constantin Musca

- add a task which creates a file for each package with the following format:

${BB_FILENAME},${SRC_URI},${SRCREV},${FROM_AUTOREV}

[YOCTO #3041]

What is the use-case for this?

Signature · 3 lines
Otavio Salvador                             O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
#2 lore raw
Quoted 5 lines · Otavio Salvador
Quoted 3 lines · Constantin Musca

- add a task which creates a file for each package with the following format:

Quoted 8 lines
Quoted 5 lines

${BB_FILENAME},${SRC_URI},${SRCREV},${FROM_AUTOREV}

[YOCTO #3041]

What is the use-case for this?

I could reply with see bug #3041!

There is a need to have the actual SRCREVs from AUTOREV'ed package version, so a build can be reproduced at a later date or so you know what SRCREV went into a given release.

Sau!

#3 lore raw
Quoted 15 lines · Saul Wold
Quoted 14 lines · Otavio Salvador
Quoted 9 lines · Constantin Musca

- add a task which creates a file for each package with the following format:

${BB_FILENAME},${SRC_URI},${SRCREV},${FROM_AUTOREV}

[YOCTO #3041]

Quoted 7 lines
Quoted 2 lines

What is the use-case for this?

I could reply with see bug #3041!

There is a need to have the actual SRCREVs from AUTOREV'ed package version, so a build can be reproduced at a later date or so you know what SRCREV went into a given release.

I know I could read the bug but this ought to be in commit log. It seems like a buildhistory thing from my POV, not another class thingy.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br