Skip to content

Commit

Permalink
stages/dnf: add module_platform_id option
Browse files Browse the repository at this point in the history
This is needed by modular repositories.
  • Loading branch information
larskarlitski authored and teg committed Nov 18, 2019
1 parent fbb43c1 commit aece548
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion stages/org.osbuild.dnf
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ STAGE_OPTS = """
"type": "array",
"items": { "type": "string" },
"default": []
}
},
"module_platform_id": {
"description": "DNF's module_platform_id option. Corresponds to PLATFORM_ID from /etc/os-release",
"type": "string"
},
}
"""

Expand Down Expand Up @@ -175,6 +179,7 @@ def main(tree, options):
operation = options.get("operation", "install")
weak_deps = options.get("install_weak_deps", True)
exclude_packages = options.get("exclude_packages", [])
module_platform_id = options.get("module_platform_id", None)

script = f"""
set -e
Expand Down Expand Up @@ -204,6 +209,9 @@ def main(tree, options):
dnfconf = f"{confdir}/dnf.conf"

with open(dnfconf, "w") as conf:
if module_platform_id:
conf.write("[main]\n")
conf.write(f"module_platform_id={module_platform_id}\n")
for num, repo in enumerate(repos):
write_repofile(conf, f"repo{num}", repo, confdir)

Expand Down

0 comments on commit aece548

Please sign in to comment.