Merge branch 'dusty-error-on-missing-add-dir' into 'main'

bootc-base-imagectl: error when --add-dir dir is missing

See merge request fedora/bootc/base-images!582
This commit is contained in:
Timothée Ravier 2026-06-22 21:59:29 +02:00
commit 0f4e4ed3b8

View file

@ -48,8 +48,11 @@ def run_build_rootfs(args):
override_manifest['ostree-override-layers'] = []
for dir in args.add_dir:
print(f"Processing --add-dir for {dir}")
base = os.path.basename(dir)
abs = os.path.realpath(dir)
if not os.path.exists(abs):
raise Exception(f"add dir directory not found: {abs}")
# capture output to hide commit digest printed
subprocess.check_output(['ostree', 'commit', '--repo', tmp_ostree_repo, '-b', f'overlay/{base}', abs,
'--owner-uid=0', '--owner-gid=0', '--no-xattrs', '--mode-ro-executables'])