stages/ostree.remotes: support contenturl

OSTree remotes can be configured with a contenturl that is separate from
the metadata url.  When specified, the contenturl is used for content
and the url is used only for metadata.
Updated the description of the url property for clarity.
This commit is contained in:
Achilleas Koutsou 2022-08-22 16:44:17 +02:00 committed by Christian Kellner
parent 2bff83364b
commit b87eaf6032

View file

@ -32,7 +32,11 @@ SCHEMA = """
"type": "string"
},
"url": {
"description": "URL of the remote",
"description": "URL for accessing metadata and content for the remote",
"type": "string"
},
"contenturl": {
"description": "URL for accessing content. When set, url is used only for metadata. Supports 'mirrorlist=' prefix",
"type": "string"
},
"branches": {
@ -85,6 +89,7 @@ def main(tree, options):
branches = remote.get("branches", [])
gpgkeys = remote.get("gpgkeys", [])
gpgkeypaths = remote.get("gpgkeypaths", [])
contenturl = remote.get("contenturl")
extra_args = []
if gpgkeypaths:
@ -94,6 +99,9 @@ def main(tree, options):
elif not gpgkeys:
extra_args += ["--no-gpg-verify"]
if contenturl:
extra_args.append(f"--set=contenturl={contenturl}")
ostree("remote", "add",
"--if-not-exists",
*extra_args,