new-updates-sync: allow for just syncing ostrees

Previously it was not able to sync just an ostree and
not a repo (i.e. an empty to: [], like we have right now
for f28).
This commit is contained in:
Dusty Mabe 2018-04-25 10:32:21 -04:00
parent fdb02f3e82
commit 88a5b49795
No known key found for this signature in database
GPG key ID: 3302DBD73952E671

View file

@ -311,20 +311,23 @@ def sync_single_release(release):
for repo in RELEASES[release]['repos']: for repo in RELEASES[release]['repos']:
target = determine_last_link(release, repo) target = determine_last_link(release, repo)
curstatefile = os.path.join(
RELEASES[release]['repos'][repo]['to'][0]['dest'], 'state')
curstate = None
if os.path.exists(curstatefile):
with open(curstatefile, 'r') as f:
curstate = f.read().split()[0]
if curstate and curstate == target: # if "to" is not empty then sync repo
logger.info('This repo has already been synced') if RELEASES[release]['repos'][repo]['to']:
else: curstatefile = os.path.join(
sync_single_repo(release, repo) RELEASES[release]['repos'][repo]['to'][0]['dest'], 'state')
with open(curstatefile, 'w') as f: curstate = None
f.write(target) if os.path.exists(curstatefile):
needssync = True with open(curstatefile, 'r') as f:
curstate = f.read().split()[0]
if curstate and curstate == target:
logger.info('This repo has already been synced')
else:
sync_single_repo(release, repo)
with open(curstatefile, 'w') as f:
f.write(target)
needssync = True
for ostree in RELEASES[release]['repos'][repo].get('ostrees', []): for ostree in RELEASES[release]['repos'][repo].get('ostrees', []):
pairs = [] pairs = []