diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-22 15:32:36 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-12-15 07:40:29 +0000 |
commit | c90ca07d378e2902271e1a0197ba2c9de0b74322 (patch) | |
tree | 76d8709a1f68485a866994e88df4e14c0a884d67 /meta | |
parent | 8eee0062a7a036d0594dff193995ac7914c6124b (diff) | |
download | poky-c90ca07d378e2902271e1a0197ba2c9de0b74322.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: f21ae68097f331e772960bdb0d488fdd53a21055)
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.bbclass | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index 49af61c9c5..b2cf9aa28a 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass | |||
@@ -960,23 +960,19 @@ def write_latest_srcrev(d, pkghistdir): | |||
960 | value = value.replace('"', '').strip() | 960 | value = value.replace('"', '').strip() |
961 | old_tag_srcrevs[key] = value | 961 | old_tag_srcrevs[key] = value |
962 | with open(srcrevfile, 'w') as f: | 962 | with open(srcrevfile, 'w') as f: |
963 | orig_srcrev = d.getVar('SRCREV', False) or 'INVALID' | 963 | for name, srcrev in sorted(srcrevs.items()): |
964 | if orig_srcrev != 'INVALID': | 964 | suffix = "_" + name |
965 | f.write('# SRCREV = "%s"\n' % orig_srcrev) | 965 | if name == "default": |
966 | if len(srcrevs) > 1: | 966 | suffix = "" |
967 | for name, srcrev in sorted(srcrevs.items()): | 967 | orig_srcrev = d.getVar('SRCREV%s' % suffix, False) |
968 | orig_srcrev = d.getVar('SRCREV_%s' % name, False) | 968 | if orig_srcrev: |
969 | if orig_srcrev: | 969 | f.write('# SRCREV%s = "%s"\n' % (suffix, orig_srcrev)) |
970 | f.write('# SRCREV_%s = "%s"\n' % (name, orig_srcrev)) | 970 | f.write('SRCREV%s = "%s"\n' % (suffix, srcrev)) |
971 | f.write('SRCREV_%s = "%s"\n' % (name, srcrev)) | 971 | for name, srcrev in sorted(tag_srcrevs.items()): |
972 | else: | 972 | f.write('# tag_%s = "%s"\n' % (name, srcrev)) |
973 | f.write('SRCREV = "%s"\n' % next(iter(srcrevs.values()))) | 973 | if name in old_tag_srcrevs and old_tag_srcrevs[name] != srcrev: |
974 | if len(tag_srcrevs) > 0: | 974 | pkg = d.getVar('PN') |
975 | for name, srcrev in sorted(tag_srcrevs.items()): | 975 | 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)) |
976 | f.write('# tag_%s = "%s"\n' % (name, srcrev)) | ||
977 | if name in old_tag_srcrevs and old_tag_srcrevs[name] != srcrev: | ||
978 | pkg = d.getVar('PN') | ||
979 | 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)) | ||
980 | 976 | ||
981 | else: | 977 | else: |
982 | if os.path.exists(srcrevfile): | 978 | if os.path.exists(srcrevfile): |