Commit 88b54fb0 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

RF: fixes to update manifest routine

parent 007e3961
......@@ -19,7 +19,7 @@ import subprocess as sp
import yaml
__version__ = '0.14.3'
__version__ = '0.14.4'
"""Current version of the fsl-ci-rules."""
......
......@@ -46,15 +46,17 @@ def update_manifest(manifest_dir, project, version):
and returns True. If <project> is already set to <version>, returns False.
"""
changed = False
releaseyml = op.join(manifest_dir, 'fsl-release.yml')
with open(op.join(manifest_dir, 'fsl-release.yml'), 'rt') as f:
with open(releaseyml, 'rt') as f:
lines = list(f.readlines())
# CUDA - assume <project>-cuda-X.Y
# see fsl_ci.recipe.get_recipe_variable
iscuda = project.endswith('cuda-X.Y')
iscuda = project.endswith('-cuda-X.Y')
if iscuda:
base = project[:-8]
base = project[:-9]
pat = rf'(.*)- ({base}-cuda-[\d]+\.[\d]+) (.*)'
else:
pat = rf'(.*)- ({project}) (.*)'
......@@ -66,18 +68,16 @@ def update_manifest(manifest_dir, project, version):
project = match.group(2)
oldversion = match.group(3)
if oldversion == version:
return False
lines[i] = f'{space}- {project} {version}\n'
break
else:
return False
if oldversion != version:
lines[i] = f'{space}- {project} {version}\n'
changed = True
with open('fsl-release.yml', 'wt') as f:
for line in lines:
f.write(line)
if changed:
with open(releaseyml, 'wt') as f:
for line in lines:
f.write(line)
return changed
def checkout_and_update_manifest(project, version, branch, server, token):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment