cmd-buildfetch: bring the ostree ref delete into the loop
There will be a ref per arch so we need to do it on each loop
iteration.
@@ -132,11 +132,6 @@ def main():
print(f"Expected sha256sum: {img['sha256']}")
raise Exception(f"Downloaded checksum for {imgpath} does not match expected")
- # and finally the symlink
- if args.build is None:
- rm_allow_noent('builds/latest')
- os.symlink(buildid, 'builds/latest')
-
# also nuke the any local matching OStree ref, since we want to build on
# top of this new one
if 'ref' in buildmeta and os.path.isdir('tmp/repo'):
@@ -144,6 +139,11 @@ def main():
'--delete', buildmeta['ref']],
stdout=subprocess.DEVNULL)
+ # and finally the symlink
+ if args.build is None:
+ rm_allow_noent('builds/latest')
+ os.symlink(buildid, 'builds/latest')
+
def parse_args():
parser = argparse.ArgumentParser()
