diff options
| -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 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): |
