Skip to content

Commit

Permalink
support multi-module modules.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Oct 31, 2023
1 parent 043370c commit 1187c12
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions build_stage_repository
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,21 @@ def create_modulemd(collection, version, stage_dir):
output = check_output(cmd, universal_newlines=True)

with open(modulemd_yaml(collection, version), 'r') as file:
modules = yaml.safe_load(file)
modules = list(yaml.safe_load_all(file))

module_version = generate_modulemd_version(version)
module_context = generate_modulemd_context(collection, version)

for module in modules:
module['data']['version'] = module_version
module['data']['context'] = module_context
if module['data']['name'] == collection:
module['data']['artifacts'] = {'rpms': output.splitlines()}

modules['data']['artifacts'] = {'rpms': output.splitlines()}
modules['data']['version'] = generate_modulemd_version(version)
modules['data']['context'] = generate_modulemd_context(collection, version)
modules_yaml = os.path.join(stage_dir, 'repodata', 'modules.yaml')

with open(modules_yaml, 'w') as modules_file:
yaml.dump(modules, modules_file, default_flow_style=False, explicit_start=True, explicit_end=True)
yaml.dump_all(modules, modules_file, default_flow_style=False, explicit_start=True, explicit_end=True)

check_output(['modifyrepo_c', '--mdtype=modules', modules_yaml, f"{stage_dir}/repodata"])

Expand Down

0 comments on commit 1187c12

Please sign in to comment.