]> code.ossystems Code Review - openembedded-core.git/commitdiff
buildhistory: fix latest_srcrev in the common case
authorChristopher Larson <chris_larson@mentor.com>
Wed, 28 Feb 2018 01:06:17 +0000 (17:06 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 5 Apr 2018 14:11:15 +0000 (15:11 +0100)
buildhistory was writing srcrevs.values() as SRCREV when only one
srcrev/branch exists. This returns a view of the dictionary values in python
3, and used to return a list in python 2, neither of which is an appropriate
value for SRCREV. It was resulting in latest_srcrev files like this:

    # SRCREV = "346584bf6e38232be8773c24fd7dedcbd7b3d9ed"
    SRCREV = "dict_values(['346584bf6e38232be8773c24fd7dedcbd7b3d9ed'])"

Which in turn would result in invalid output in buildhistory-collect-srcrevs.
Fix by calling `next(iter())` on the `.values()`

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
(cherry picked from commit ef826a395612400924bbe49859d256b237ff59e1)
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/classes/buildhistory.bbclass

index 3a5bc2c3e3cbef6e1a515d32deac7cec0fa811b6..d82e9bb55cd7722c1947d7e90d46bfea5f0aa77c 100644 (file)
@@ -833,7 +833,7 @@ python write_srcrev() {
                         f.write('# SRCREV_%s = "%s"\n' % (name, orig_srcrev))
                     f.write('SRCREV_%s = "%s"\n' % (name, srcrev))
             else:
-                f.write('SRCREV = "%s"\n' % srcrevs.values())
+                f.write('SRCREV = "%s"\n' % next(iter(srcrevs.values())))
             if len(tag_srcrevs) > 0:
                 for name, srcrev in tag_srcrevs.items():
                     f.write('# tag_%s = "%s"\n' % (name, srcrev))