init_series: no longer skip over unreleased

Support 'stable' deliverables in init_series by not skipping
over deliverables that did not get any old_series release.
Add a warning to the generated YAML file instead.

Change-Id: I0b79354f01604641a348db50fcbb43376ae3111d
Task: 22350
This commit is contained in:
Thierry Carrez 2018-07-04 14:40:58 +02:00
parent ad86c5a109
commit 30c6258ab4

View File

@ -60,16 +60,11 @@ def main():
print('creating output directory {}'.format(outdir)) print('creating output directory {}'.format(outdir))
os.mkdir(outdir) os.mkdir(outdir)
warn = '# Note: deliverable was not released in %s\n' % args.old_series
old_deliverables = all_deliv.get_deliverables(None, args.old_series) old_deliverables = all_deliv.get_deliverables(None, args.old_series)
for deliv in old_deliverables: for deliv in old_deliverables:
if deliv.name in new_deliverables: if deliv.name in new_deliverables:
continue continue
if not deliv.is_released and not deliv.branches:
# There were no releases for the deliverable in the
# previous series, stop carrying it over.
print('{} skipped (no releases in {})'.format(
deliv.name, args.old_series))
continue
# Clean up some series-specific data that should not be copied # Clean up some series-specific data that should not be copied
# over. # over.
raw_data = deliv.data raw_data = deliv.data
@ -82,3 +77,7 @@ def main():
with open(outfilename, 'w', encoding='utf-8') as f: with open(outfilename, 'w', encoding='utf-8') as f:
print('{} created'.format(outfilename)) print('{} created'.format(outfilename))
f.write(yamlutils.dumps(raw_data)) f.write(yamlutils.dumps(raw_data))
if not deliv.is_released and not deliv.branches:
# There were no releases for the deliverable in the
# previous series, add a comment in the file.
f.write(warn)