import_layers: use vcs_last_rev to check if record is updated

Unfortunately the "updated" date gets changed every time the repo is
fetched (i.e. vcs_last_fetch changes), but that doesn't mean the
layerbranch or anything under it has actually changed. Use vcs_last_rev
instead although unfortunately that won't catch manual edits to the
layerbranch alone.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2019-09-20 09:27:13 +12:00
parent 5f81885a57
commit 16734d7082

View File

@ -323,7 +323,7 @@ def main():
# that already existed, since we need to have those in layer_idmap
# to be able to import layer dependencies)
existing_layerbranches.remove(layerbranch.id)
if layerbranchjs['updated'] <= layerbranch.updated and not args.reload:
if layerbranchjs['vcs_last_rev'] == layerbranch.vcs_last_rev and not args.reload:
logger.debug('Skipping layerbranch %s, already up-to-date' % layerbranchjs['id'])
layerbranch_idmap[layerbranchjs['id']] = layerbranch
continue