sources: rename org.osbuild.{files -> curl}

The `org.osbuild.files` source provides files, but might in the
future not be the only one that does. Therefore rename it to
match the internal tool that is being used to fetch the files.
This is done for most other osbuild modules that target tools.

The format v1 loader is adapted to make this change transparent
for users of the v1 format, so we are backwards compatible.

Change the MPP depsolve preprocessor so that for format v2 based
manifest `org.osbuild.curl` source is used. Also rename the
corresponding source test. Adapt the format v2 mod test to use
the curl source.
This commit is contained in:
Christian Kellner 2021-02-12 17:36:14 +01:00
parent fa9c288988
commit 81c8374d3e
40 changed files with 52 additions and 41 deletions

View file

@ -40,6 +40,12 @@ def describe(manifest: Manifest, *, with_id=False) -> Dict:
return description
def get_source_name(source):
name = source.info.name
if name == "org.osbuild.curl":
name = "org.osbuild.files"
return name
pipeline = describe_pipeline(manifest["tree"])
assembler = manifest.get("assembler")
@ -51,7 +57,7 @@ def describe(manifest: Manifest, *, with_id=False) -> Dict:
if manifest.sources:
sources = {
s.info.name: s.options
get_source_name(s): s.options
for s in manifest.sources
}
description["sources"] = sources
@ -115,9 +121,12 @@ def load_stage(description: Dict, index: Index, pipeline: Pipeline):
def load_source(name: str, description: Dict, index: Index, manifest: Manifest):
if name == "org.osbuild.files":
name = "org.osbuild.curl"
info = index.get_module_info("Source", name)
if name == "org.osbuild.files":
if name == "org.osbuild.curl":
items = description["urls"]
elif name == "org.osbuild.ostree":
items = description["commits"]
@ -268,6 +277,8 @@ def validate(manifest: Dict, index: Index) -> ValidationResult:
# sources
sources = manifest.get("sources", {})
for name, source in sources.items():
if name == "org.osbuild.files":
name = "org.osbuild.curl"
schema = index.get_schema("Source", name)
res = schema.validate(source)
result.merge(res, path=["sources", name])

View file

@ -255,7 +255,7 @@
}
],
"sources": {
"org.osbuild.files": {
"org.osbuild.curl": {
"items": {
"sha256:705bdb96aab3a0f9d9e2ff48ead1208e2dbc1927d713d8637632af936235217b": "https://rpmrepo.osbuild.org/v1/anon/f32/f32-x86_64-fedora-20201010/Packages/a/acl-2.2.53-5.fc32.x86_64.rpm",
"sha256:c574c5432197acbe08ea15c7837be7577cd0b49902a3e65227792f051d73ce5c": "https://rpmrepo.osbuild.org/v1/anon/f32/f32-x86_64-fedora-20201010/Packages/a/alternatives-1.11-6.fc32.x86_64.rpm",

View file

@ -479,7 +479,7 @@
}
],
"sources": {
"org.osbuild.files": {
"org.osbuild.curl": {
"items": {
"sha256:705bdb96aab3a0f9d9e2ff48ead1208e2dbc1927d713d8637632af936235217b": "https://rpmrepo.osbuild.org/v1/anon/f32/f32-x86_64-fedora-20201010/Packages/a/acl-2.2.53-5.fc32.x86_64.rpm",
"sha256:c574c5432197acbe08ea15c7837be7577cd0b49902a3e65227792f051d73ce5c": "https://rpmrepo.osbuild.org/v1/anon/f32/f32-x86_64-fedora-20201010/Packages/a/alternatives-1.11-6.fc32.x86_64.rpm",

View file

@ -947,7 +947,7 @@
}
],
"sources": {
"org.osbuild.files": {
"org.osbuild.curl": {
"items": {
"sha256:342bdf0143d9145f8846e1b5c3401685e0d1274b66df39ac8cbfb78013313861": "https://rpmrepo.osbuild.org/v1/anon/f32/f32-x86_64-fedora-20201010/Packages/n/NetworkManager-1.22.10-1.fc32.x86_64.rpm",
"sha256:fd2a2dd726d855f877296227fb351883d647df28b1b0085f525d87df622d49e4": "https://rpmrepo.osbuild.org/v1/anon/f32/f32-x86_64-fedora-20201010/Packages/n/NetworkManager-libnm-1.22.10-1.fc32.x86_64.rpm",

View file

@ -0,0 +1,34 @@
{
"org.osbuild.curl": {
"urls": {
"sha256:87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7": "http://localhost/sources/org.osbuild.curl/data/a",
"sha256:0263829989b6fd954f72baaf2fc64bc2e2f01d692d4de72986ea808f6e99813f": "http://localhost/sources/org.osbuild.curl/data/b",
"sha256:a3a5e715f0cc574a73c3f9bebb6bc24f32ffd5b67b387244c2c909da779a1478": "http://localhost/sources/org.osbuild.curl/data/c",
"sha256:8d74beec1be996322ad76813bafb92d40839895d6dd7ee808b17ca201eac98be": "http://localhost/sources/org.osbuild.curl/data/d",
"sha256:a2bbdb2de53523b8099b37013f251546f3d65dbe7a0774fa41af0a4176992fd4": "http://localhost/sources/org.osbuild.curl/data/e",
"sha256:092fcfbbcfca3b5be7ae1b5e58538e92c35ab273ae13664fed0d67484c8e78a6": "http://localhost/sources/org.osbuild.curl/data/f",
"sha256:768c71d785bf6bbbf8c4d6af6582041f2659027140a962cd0c55b11eddfd5e3d": "http://localhost/sources/org.osbuild.curl/data/g",
"sha256:91ee5e9f42ba3d34e414443b36a27b797a56a47aad6bb1e4c1769e69c77ce0ca": "http://localhost/sources/org.osbuild.curl/data/h",
"sha256:50c393f158c3de2db92fa9661bfb00eda5b67c3a777c88524ed3417509631625": "http://localhost/sources/org.osbuild.curl/data/i",
"sha256:cee00b08a818db87e17e703273818e5194f83280e1ef3eae9214ff14675d9e6d": "http://localhost/sources/org.osbuild.curl/data/j",
"sha256:19732980d68fbd00358a0a4d98246c960400b87e4fa2a2e155db98be2b42ed6c": "http://localhost/sources/org.osbuild.curl/data/k",
"sha256:6d7ebc44c5bc26207e62f4f628f912e1a0f41ed11764891aa7dd99eab83228e7": "http://localhost/sources/org.osbuild.curl/data/l",
"sha256:01a60e35df88d8b49546cb3f8f4ba4f406870f9b8e1f394c9d48ab73548d748d": "http://localhost/sources/org.osbuild.curl/data/m",
"sha256:a4fb621495a0122493b2203591c448903c472e306a1ede54fabad829e01075c0": "http://localhost/sources/org.osbuild.curl/data/n",
"sha256:7427d152005f9ed0fa31c76ef9963cf4bb47dce6e2768111d9eb0edbfe59c704": "http://localhost/sources/org.osbuild.curl/data/o",
"sha256:fd6641673e7f3bf6e80e4bc5401fcb2821a1e117206c8e1c65cef23a58dc37ff": "http://localhost/sources/org.osbuild.curl/data/p",
"sha256:4adc33bd9fe74303c344be46e5916d65182fb218e248fe80452ab3f025b06c64": "http://localhost/sources/org.osbuild.curl/data/q",
"sha256:8e54b0ca18020275e4aef1ca0eb5e197e066c065c1864817652a8a39c55402cd": "http://localhost/sources/org.osbuild.curl/data/r",
"sha256:cbc80bb5c0c0f8944bf73b3a429505ac5cde16644978bc9a1e74c5755f8ca556": "http://localhost/sources/org.osbuild.curl/data/s",
"sha256:fe8edeeb98cc6d3b93cf2d57000254b84bd9eba34b4df7ce4b87db8b937b7703": "http://localhost/sources/org.osbuild.curl/data/t",
"sha256:ea46748e171abd2dd4dba5b86bb6589334d86bba2df8d50cbb16b36c83b0856a": "http://localhost/sources/org.osbuild.curl/data/u",
"sha256:73324e1ab1db72ee9eb4fdf1c90a586d67e00ab58330d1cbfea26ecd0a77fa4d": "http://localhost/sources/org.osbuild.curl/data/v",
"sha256:cf945b5236e101dbe0471d5200f28b1ae64f21c1f35bf55fcf40cd0fe42cd8e7": "http://localhost/sources/org.osbuild.curl/data/w",
"sha256:73cb3858a687a8494ca3323053016282f3dad39d42cf62ca4e79dda2aac7d9ac": "http://localhost/sources/org.osbuild.curl/data/x",
"sha256:3bb2abb69ebb27fbfe63c7639624c6ec5e331b841a5bc8c3ebc10b9285e90877": "http://localhost/sources/org.osbuild.curl/data/y",
"sha256:c865f6c5ab8d1b0bcd383a5e1e3879d22681c96bf462c269b7581d523fbe70ab": "http://localhost/sources/org.osbuild.curl/data/z",
"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa": "http://localhost/sources/org.osbuild.curl/data/a",
"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb": "http://localhost/sources/org.osbuild.curl/data/missing"
}
}
}

View file

@ -1,34 +0,0 @@
{
"org.osbuild.files": {
"urls": {
"sha256:87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7": "http://localhost/sources/org.osbuild.files/data/a",
"sha256:0263829989b6fd954f72baaf2fc64bc2e2f01d692d4de72986ea808f6e99813f": "http://localhost/sources/org.osbuild.files/data/b",
"sha256:a3a5e715f0cc574a73c3f9bebb6bc24f32ffd5b67b387244c2c909da779a1478": "http://localhost/sources/org.osbuild.files/data/c",
"sha256:8d74beec1be996322ad76813bafb92d40839895d6dd7ee808b17ca201eac98be": "http://localhost/sources/org.osbuild.files/data/d",
"sha256:a2bbdb2de53523b8099b37013f251546f3d65dbe7a0774fa41af0a4176992fd4": "http://localhost/sources/org.osbuild.files/data/e",
"sha256:092fcfbbcfca3b5be7ae1b5e58538e92c35ab273ae13664fed0d67484c8e78a6": "http://localhost/sources/org.osbuild.files/data/f",
"sha256:768c71d785bf6bbbf8c4d6af6582041f2659027140a962cd0c55b11eddfd5e3d": "http://localhost/sources/org.osbuild.files/data/g",
"sha256:91ee5e9f42ba3d34e414443b36a27b797a56a47aad6bb1e4c1769e69c77ce0ca": "http://localhost/sources/org.osbuild.files/data/h",
"sha256:50c393f158c3de2db92fa9661bfb00eda5b67c3a777c88524ed3417509631625": "http://localhost/sources/org.osbuild.files/data/i",
"sha256:cee00b08a818db87e17e703273818e5194f83280e1ef3eae9214ff14675d9e6d": "http://localhost/sources/org.osbuild.files/data/j",
"sha256:19732980d68fbd00358a0a4d98246c960400b87e4fa2a2e155db98be2b42ed6c": "http://localhost/sources/org.osbuild.files/data/k",
"sha256:6d7ebc44c5bc26207e62f4f628f912e1a0f41ed11764891aa7dd99eab83228e7": "http://localhost/sources/org.osbuild.files/data/l",
"sha256:01a60e35df88d8b49546cb3f8f4ba4f406870f9b8e1f394c9d48ab73548d748d": "http://localhost/sources/org.osbuild.files/data/m",
"sha256:a4fb621495a0122493b2203591c448903c472e306a1ede54fabad829e01075c0": "http://localhost/sources/org.osbuild.files/data/n",
"sha256:7427d152005f9ed0fa31c76ef9963cf4bb47dce6e2768111d9eb0edbfe59c704": "http://localhost/sources/org.osbuild.files/data/o",
"sha256:fd6641673e7f3bf6e80e4bc5401fcb2821a1e117206c8e1c65cef23a58dc37ff": "http://localhost/sources/org.osbuild.files/data/p",
"sha256:4adc33bd9fe74303c344be46e5916d65182fb218e248fe80452ab3f025b06c64": "http://localhost/sources/org.osbuild.files/data/q",
"sha256:8e54b0ca18020275e4aef1ca0eb5e197e066c065c1864817652a8a39c55402cd": "http://localhost/sources/org.osbuild.files/data/r",
"sha256:cbc80bb5c0c0f8944bf73b3a429505ac5cde16644978bc9a1e74c5755f8ca556": "http://localhost/sources/org.osbuild.files/data/s",
"sha256:fe8edeeb98cc6d3b93cf2d57000254b84bd9eba34b4df7ce4b87db8b937b7703": "http://localhost/sources/org.osbuild.files/data/t",
"sha256:ea46748e171abd2dd4dba5b86bb6589334d86bba2df8d50cbb16b36c83b0856a": "http://localhost/sources/org.osbuild.files/data/u",
"sha256:73324e1ab1db72ee9eb4fdf1c90a586d67e00ab58330d1cbfea26ecd0a77fa4d": "http://localhost/sources/org.osbuild.files/data/v",
"sha256:cf945b5236e101dbe0471d5200f28b1ae64f21c1f35bf55fcf40cd0fe42cd8e7": "http://localhost/sources/org.osbuild.files/data/w",
"sha256:73cb3858a687a8494ca3323053016282f3dad39d42cf62ca4e79dda2aac7d9ac": "http://localhost/sources/org.osbuild.files/data/x",
"sha256:3bb2abb69ebb27fbfe63c7639624c6ec5e331b841a5bc8c3ebc10b9285e90877": "http://localhost/sources/org.osbuild.files/data/y",
"sha256:c865f6c5ab8d1b0bcd383a5e1e3879d22681c96bf462c269b7581d523fbe70ab": "http://localhost/sources/org.osbuild.files/data/z",
"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa": "http://localhost/sources/org.osbuild.files/data/a",
"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb": "http://localhost/sources/org.osbuild.files/data/missing"
}
}
}

View file

@ -12,7 +12,7 @@ import osbuild.meta
BASIC_PIPELINE = {
"version": "2",
"sources": {
"org.osbuild.files": {
"org.osbuild.curl": {
"items": {
"sha256:6eeebf21f245bf0d6f58962dc49b6dfb51f55acb6a595c6b9cbe9628806b80a4":
"https://internet/curl-7.69.1-1.fc32.x86_64.rpm",

View file

@ -222,7 +222,7 @@ def _manifest_parse_v2(state, manifest):
todo.append(packages)
sources = _manifest_enter(manifest, "sources", {})
files = _manifest_enter(sources, "org.osbuild.files", {})
files = _manifest_enter(sources, "org.osbuild.curl", {})
urls = _manifest_enter(files, "items", {})
state.manifest = manifest