Only sync ostrees if refs are updated
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
This commit is contained in:
parent
6870c18197
commit
2c61d942b3
1 changed files with 10 additions and 8 deletions
|
@ -116,14 +116,16 @@ def get_ostree_ref(repo, ref):
|
||||||
|
|
||||||
|
|
||||||
def sync_ostree(dst, ref):
|
def sync_ostree(dst, ref):
|
||||||
pre_commit = get_ostree_ref(dst, ref)
|
src_commit = get_ostree_ref(ATOMICSOURCE, ref)
|
||||||
logger.info('Previous commit: %s', pre_commit)
|
dst_commit = get_ostree_ref(dst, ref)
|
||||||
cmd = ['ostree', 'pull-local', '--verbose', '--repo', dst, ATOMICSOURCE, ref]
|
if src_commit == dst_commit:
|
||||||
out = run_command(cmd)
|
logger.info('OSTree at %s, ref %s in sync', dst, ref)
|
||||||
logger.info('Ostree output: %s', out)
|
else:
|
||||||
post_commit = get_ostree_ref(dst, ref)
|
logger.info('Syncing OSTree to %s, ref %s: %s -> %s',
|
||||||
logger.info('New commit: %s', post_commit)
|
dst, ref, src_commit, dst_commit)
|
||||||
if pre_commit != post_commit:
|
cmd = ['ostree', 'pull-local', '--verbose', '--repo',
|
||||||
|
dst, ATOMICSOURCE, ref]
|
||||||
|
out = run_command(cmd)
|
||||||
cmd = ['ostree', 'summary', '--verbose', '--repo', dst, '--update']
|
cmd = ['ostree', 'summary', '--verbose', '--repo', dst, '--update']
|
||||||
run_command(cmd)
|
run_command(cmd)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue