Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/nixguix/loader.py
Show First 20 Lines • Show All 230 Lines • ▼ Show 20 Lines | if missing_keys != []: | ||||
raise ValueError( | raise ValueError( | ||||
f"sources structure invalid, missing: {','.join(missing_keys)}" | f"sources structure invalid, missing: {','.join(missing_keys)}" | ||||
) | ) | ||||
# Only the version 1 is currently supported | # Only the version 1 is currently supported | ||||
version = int(sources["version"]) | version = int(sources["version"]) | ||||
if version != 1: | if version != 1: | ||||
raise ValueError( | raise ValueError( | ||||
"The sources structure version '%d' is not supported", sources["version"] | f"The sources structure version '{sources['version']}' is not supported" | ||||
) | ) | ||||
# If a source doesn't contain required attributes, this source is | # If a source doesn't contain required attributes, this source is | ||||
# skipped but others could still be archived. | # skipped but others could still be archived. | ||||
verified_sources = [] | verified_sources = [] | ||||
for source in sources["sources"]: | for source in sources["sources"]: | ||||
valid = True | valid = True | ||||
required_keys = ["urls", "integrity", "type"] | required_keys = ["urls", "integrity", "type"] | ||||
Show All 23 Lines |