summaryrefslogtreecommitdiffstats
path: root/meta/classes
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-08 20:28:01 +0000
commit038e25aec3b70ea847736be288f66afbde4d2f3d (patch)
tree6ef03a43a1a3e77296a58227aed3f4372c66d26e /meta/classes
parent1a6bf73119896e011940520b495a66b1285acdaa (diff)
downloadpoky-038e25aec3b70ea847736be288f66afbde4d2f3d.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: 9a7ea10660d0efd87e8cadf866e6dbed112b7f94) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 45ae567932ba52b758eb41754453e9828d9533a1) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-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 44a66df962..2746996cbb 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -953,23 +953,19 @@ def write_latest_srcrev(d, pkghistdir):
953 value = value.replace('"', '').strip() 953 value = value.replace('"', '').strip()
954 old_tag_srcrevs[key] = value 954 old_tag_srcrevs[key] = value
955 with open(srcrevfile, 'w') as f: 955 with open(srcrevfile, 'w') as f:
956 orig_srcrev = d.getVar('SRCREV', False) or 'INVALID' 956 for name, srcrev in sorted(srcrevs.items()):
957 if orig_srcrev != 'INVALID': 957 suffix = "_" + name
958 f.write('# SRCREV = "%s"\n' % orig_srcrev) 958 if name == "default":
959 if len(srcrevs) > 1: 959 suffix = ""
960 for name, srcrev in sorted(srcrevs.items()): 960 orig_srcrev = d.getVar('SRCREV%s' % suffix, False)
961 orig_srcrev = d.getVar('SRCREV_%s' % name, False) 961 if orig_srcrev:
962 if orig_srcrev: 962 f.write('# SRCREV%s = "%s"\n' % (suffix, orig_srcrev))
963 f.write('# SRCREV_%s = "%s"\n' % (name, orig_srcrev)) 963 f.write('SRCREV%s = "%s"\n' % (suffix, srcrev))
964 f.write('SRCREV_%s = "%s"\n' % (name, srcrev)) 964 for name, srcrev in sorted(tag_srcrevs.items()):
965 else: 965 f.write('# tag_%s = "%s"\n' % (name, srcrev))
966 f.write('SRCREV = "%s"\n' % next(iter(srcrevs.values()))) 966 if name in old_tag_srcrevs and old_tag_srcrevs[name] != srcrev:
967 if len(tag_srcrevs) > 0: 967 pkg = d.getVar('PN')
968 for name, srcrev in sorted(tag_srcrevs.items()): 968 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))
969 f.write('# tag_%s = "%s"\n' % (name, srcrev))
970 if name in old_tag_srcrevs and old_tag_srcrevs[name] != srcrev:
971 pkg = d.getVar('PN')
972 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))
973 969
974 else: 970 else:
975 if os.path.exists(srcrevfile): 971 if os.path.exists(srcrevfile):