summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2013-04-03 10:49:36 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-04-04 14:04:41 +0100
commitd040acb90453b77c31aab00b7450d81633fe6791 (patch)
treeb4605983abe74e4b96ba32b53f5e1115c9941018 /meta
parentfe336b149552b1f4f24d979c40302653298b98cc (diff)
downloadast2050-yocto-poky-d040acb90453b77c31aab00b7450d81633fe6791.zip
ast2050-yocto-poky-d040acb90453b77c31aab00b7450d81633fe6791.tar.gz
buildhistory: record tag names and show warning when the same tag corresponds to different revision
* persistent cache records tag-srcrev mappings, but is not shared between builders * when tag is moved in remote repo, all builders should rebuild the component to use the same source, show warning when revision is different than what was used in last build (From OE-Core rev: 0bc22ed6bd67031749e8f2cb5415dabf933eef56) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/buildhistory.bbclass29
1 files changed, 25 insertions, 4 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 82d0bf8..8c9f794 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -538,24 +538,38 @@ def _get_srcrev_values(d):
scms.append(u)
autoinc_templ = 'AUTOINC+'
- dict = {}
+ dict_srcrevs = {}
+ dict_tag_srcrevs = {}
for scm in scms:
ud = urldata[scm]
for name in ud.names:
rev = ud.method.sortable_revision(scm, ud, d, name)
if rev.startswith(autoinc_templ):
rev = rev[len(autoinc_templ):]
- dict[name] = rev
- return dict
+ dict_srcrevs[name] = rev
+ if 'tag' in ud.parm:
+ tag = ud.parm['tag'];
+ key = name+'_'+tag
+ dict_tag_srcrevs[key] = rev
+ return (dict_srcrevs, dict_tag_srcrevs)
python do_write_srcrev() {
pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE', True)
srcrevfile = os.path.join(pkghistdir, 'latest_srcrev')
- srcrevs = _get_srcrev_values(d)
+ srcrevs, tag_srcrevs = _get_srcrev_values(d)
if srcrevs:
if not os.path.exists(pkghistdir):
os.makedirs(pkghistdir)
+ old_tag_srcrevs = {}
+ if os.path.exists(srcrevfile):
+ with open(srcrevfile) as f:
+ for line in f:
+ if line.startswith('# tag_'):
+ key, value = line.split("=", 1)
+ key = key.replace('# tag_', '').strip()
+ value = value.replace('"', '').strip()
+ old_tag_srcrevs[key] = value
with open(srcrevfile, 'w') as f:
orig_srcrev = d.getVar('SRCREV', False) or 'INVALID'
if orig_srcrev != 'INVALID':
@@ -568,6 +582,13 @@ python do_write_srcrev() {
f.write('SRCREV_%s = "%s"\n' % (name, srcrev))
else:
f.write('SRCREV = "%s"\n' % srcrevs.itervalues().next())
+ if len(tag_srcrevs) > 0:
+ for name, srcrev in tag_srcrevs.items():
+ f.write('# tag_%s = "%s"\n' % (name, srcrev))
+ if name in old_tag_srcrevs and old_tag_srcrevs[name] != srcrev:
+ pkg = d.getVar('PN', True)
+ 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))
+
else:
if os.path.exists(srcrevfile):
os.remove(srcrevfile)
OpenPOWER on IntegriCloud