summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2018-02-28 01:06:17 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-04-05 14:13:48 (GMT)
commitf6d64b08d413404a86ffbf808c66978621f4069b (patch)
treec25655604fa88283783ef15d8cc0100e9c1f933e
parent134aa03cd772b539e6fe77acf6c9625293c6e047 (diff)
downloadpoky-f6d64b08d413404a86ffbf808c66978621f4069b.tar.gz
buildhistory: fix latest_srcrev in the common case
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()` (From OE-Core rev: 4243555ab91ab763a098259011dfa72156bfe0b3) 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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/buildhistory.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 3a5bc2c..d82e9bb 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -833,7 +833,7 @@ python write_srcrev() {
833 f.write('# SRCREV_%s = "%s"\n' % (name, orig_srcrev)) 833 f.write('# SRCREV_%s = "%s"\n' % (name, orig_srcrev))
834 f.write('SRCREV_%s = "%s"\n' % (name, srcrev)) 834 f.write('SRCREV_%s = "%s"\n' % (name, srcrev))
835 else: 835 else:
836 f.write('SRCREV = "%s"\n' % srcrevs.values()) 836 f.write('SRCREV = "%s"\n' % next(iter(srcrevs.values())))
837 if len(tag_srcrevs) > 0: 837 if len(tag_srcrevs) > 0:
838 for name, srcrev in tag_srcrevs.items(): 838 for name, srcrev in tag_srcrevs.items():
839 f.write('# tag_%s = "%s"\n' % (name, srcrev)) 839 f.write('# tag_%s = "%s"\n' % (name, srcrev))