summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-22 15:32:36 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-12-13 23:02:49 +0000
commitca4ecac8dd31a0cd63efd4daf7190c57fdd5334d (patch)
tree8bb9d1a2457548c14cd8519e993725d51fe8d2db /meta
parent001c21e32e9bdad57a5b092bc81bdbb652ba4fe4 (diff)
downloadpoky-ca4ecac8dd31a0cd63efd4daf7190c57fdd5334d.tar.gz
buildhistory: Fix srcrevs output
The code was assuming that the a recipe with only one srcrev wouldn't "name" it. This isn't the case as the glibc or bzip2 recipes show, you can have a single srcrev which is named. We can pull the data from the fetcher and in fact we already have it, we just need to handle the "default" case and make that code the default for all srcrev regardless of length. [YOCTO #14017] (From OE-Core rev: 8b6e565afcfb73a33e3759486554365798e74d66) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 45ae567932ba52b758eb41754453e9828d9533a1) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/buildhistory.bbclass30
1 files changed, 13 insertions, 17 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 7c44fec2d1..810c4fae73 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -979,23 +979,19 @@ def write_latest_srcrev(d, pkghistdir):
979 value = value.replace('"', '').strip() 979 value = value.replace('"', '').strip()
980 old_tag_srcrevs[key] = value 980 old_tag_srcrevs[key] = value
981 with open(srcrevfile, 'w') as f: 981 with open(srcrevfile, 'w') as f:
982 orig_srcrev = d.getVar('SRCREV', False) or 'INVALID' 982 for name, srcrev in sorted(srcrevs.items()):
983 if orig_srcrev != 'INVALID': 983 suffix = "_" + name
984 f.write('# SRCREV = "%s"\n' % orig_srcrev) 984 if name == "default":
985 if len(srcrevs) > 1: 985 suffix = ""
986 for name, srcrev in sorted(srcrevs.items()): 986 orig_srcrev = d.getVar('SRCREV%s' % suffix, False)
987 orig_srcrev = d.getVar('SRCREV_%s' % name, False) 987 if orig_srcrev:
988 if orig_srcrev: 988 f.write('# SRCREV%s = "%s"\n' % (suffix, orig_srcrev))
989 f.write('# SRCREV_%s = "%s"\n' % (name, orig_srcrev)) 989 f.write('SRCREV%s = "%s"\n' % (suffix, srcrev))
990 f.write('SRCREV_%s = "%s"\n' % (name, srcrev)) 990 for name, srcrev in sorted(tag_srcrevs.items()):
991 else: 991 f.write('# tag_%s = "%s"\n' % (name, srcrev))
992 f.write('SRCREV = "%s"\n' % next(iter(srcrevs.values()))) 992 if name in old_tag_srcrevs and old_tag_srcrevs[name] != srcrev:
993 if len(tag_srcrevs) > 0: 993 pkg = d.getVar('PN')
994 for name, srcrev in sorted(tag_srcrevs.items()): 994 bb.warn("Revision for tag %s in package %s was changed since last build (from %s to %s)" % (name, pkg, old_tag_srcrevs[name], srcrev))
995 f.write('# tag_%s = "%s"\n' % (name, srcrev))
996 if name in old_tag_srcrevs and old_tag_srcrevs[name] != srcrev:
997 pkg = d.getVar('PN')
998 bb.warn("Revision for tag %s in package %s was changed since last build (from %s to %s)" % (name, pkg, old_tag_srcrevs[name], srcrev))
999 995
1000 else: 996 else:
1001 if os.path.exists(srcrevfile): 997 if os.path.exists(srcrevfile):