bootc-base-imagectl: simplify manifest path logic

The `if os.path.isdir(args.manifest)` bit dates from the introduction
of this script, but doesn't really work. I suspect the intent here was
to abstract over some manifests being top-level YAML files and others
being directories).

Except that:
1. The script didn't actually check the right path. It's checking
   `$PWD/{args.manifest}` instead of `$MANIFESTDIR/{args.manifest}`.
2. `list` doesn't have the equivalent logic to look for `manifest.yaml`
   files in subdirectories.
3. Nowadays, there is both a e.g. `standard.yaml` _and_ a
   `standard/manifest.yaml` directory. The established semantic there
   AIUI is that the top-level manifests are opinionated for a specific
   OS (Fedora/CentOS/RHEL), whereas the directories are shared across
   all of those.

So let's just nuke support for the directory path.
This commit is contained in:
Jonathan Lebon 2025-06-17 14:57:25 -04:00
parent 040f6319f5
commit c2ff52a7cf
No known key found for this signature in database

View file

@ -17,10 +17,7 @@ def run_build_rootfs(args):
Regenerates a base image using a build configuration.
"""
target = args.target
if os.path.isdir(args.manifest):
manifest_path = os.path.join(f'/{MANIFESTDIR}', args.manifest, 'manifest.yaml')
else:
manifest_path = f'/{MANIFESTDIR}/{args.manifest}.yaml'
manifest_path = f'/{MANIFESTDIR}/{args.manifest}.yaml'
rpmostree_argv = ['rpm-ostree', 'compose', 'rootfs']