diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-22 15:32:36 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-23 10:53:15 +0000 |
commit | 96f552377a25f21f24aadb6f326f177d56aa9d73 (patch) | |
tree | 085a30a68fed72005be6fddc896f55eb4bee6c2a /meta | |
parent | 481944090479c467abf82625d24b95c1ed5cc643 (diff) | |
download | poky-96f552377a25f21f24aadb6f326f177d56aa9d73.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: 45ae567932ba52b758eb41754453e9828d9533a1)
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 e43e71f90f..64df432f13 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass | |||
@@ -970,23 +970,19 @@ def write_latest_srcrev(d, pkghistdir): | |||
970 | value = value.replace('"', '').strip() | 970 | value = value.replace('"', '').strip() |
971 | old_tag_srcrevs[key] = value | 971 | old_tag_srcrevs[key] = value |
972 | with open(srcrevfile, 'w') as f: | 972 | with open(srcrevfile, 'w') as f: |
973 | orig_srcrev = d.getVar('SRCREV', False) or 'INVALID' | 973 | for name, srcrev in sorted(srcrevs.items()): |
974 | if orig_srcrev != 'INVALID': | 974 | suffix = "_" + name |
975 | f.write('# SRCREV = "%s"\n' % orig_srcrev) | 975 | if name == "default": |
976 | if len(srcrevs) > 1: | 976 | suffix = "" |
977 | for name, srcrev in sorted(srcrevs.items()): | 977 | orig_srcrev = d.getVar('SRCREV%s' % suffix, False) |
978 | orig_srcrev = d.getVar('SRCREV_%s' % name, False) | 978 | if orig_srcrev: |
979 | if orig_srcrev: | 979 | f.write('# SRCREV%s = "%s"\n' % (suffix, orig_srcrev)) |
980 | f.write('# SRCREV_%s = "%s"\n' % (name, orig_srcrev)) | 980 | f.write('SRCREV%s = "%s"\n' % (suffix, srcrev)) |
981 | f.write('SRCREV_%s = "%s"\n' % (name, srcrev)) | 981 | for name, srcrev in sorted(tag_srcrevs.items()): |
982 | else: | 982 | f.write('# tag_%s = "%s"\n' % (name, srcrev)) |
983 | f.write('SRCREV = "%s"\n' % next(iter(srcrevs.values()))) | 983 | if name in old_tag_srcrevs and old_tag_srcrevs[name] != srcrev: |
984 | if len(tag_srcrevs) > 0: | 984 | pkg = d.getVar('PN') |
985 | for name, srcrev in sorted(tag_srcrevs.items()): | 985 | 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)) |
986 | f.write('# tag_%s = "%s"\n' % (name, srcrev)) | ||
987 | if name in old_tag_srcrevs and old_tag_srcrevs[name] != srcrev: | ||
988 | pkg = d.getVar('PN') | ||
989 | 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)) | ||
990 | 986 | ||
991 | else: | 987 | else: |
992 | if os.path.exists(srcrevfile): | 988 | if os.path.exists(srcrevfile): |