-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Currently, the update script contains a case distinction for several hard-coded distros, like so:
if image["shortname"] in ["rocky-8", "rocky-9"]:
splitted_line = re.split("\s+", line) # noqa W605
if splitted_line[0] == "SHA256":
checksums[latest_filename] = splitted_line[3]
elif image["shortname"] in [
"ubuntu-14.04",
"ubuntu-16.04",
"ubuntu-16.04-minimal",
"ubuntu-18.04",
"ubuntu-18.04-minimal",
"ubuntu-20.04",
"ubuntu-20.04-minimal",
"ubuntu-22.04",
"ubuntu-22.04-minimal",
]:
splitted_line = re.split("\s+", line) # noqa W605
if len(splitted_line) == 2:
checksums[splitted_line[1][1:]] = splitted_line[0]
elif image["shortname"] in ["centos-7"]:
splitted_line = re.split("\s+", line) # noqa W605
if len(splitted_line) == 2:
if re.search(filename_pattern, splitted_line[1]):
checksums[splitted_line[1]] = splitted_line[0]
elif image["shortname"] in ["centos-stream-8", "centos-stream-9"]:
splitted_line = re.split("\s+", line) # noqa W605
if splitted_line[0] == "SHA256" and re.search(
filename_pattern, splitted_line[1][1:-1]
):
checksums[splitted_line[1][1:-1]] = splitted_line[3]
else:
splitted_line = re.split("\s+", line) # noqa W605
if len(splitted_line) == 2:
checksums[splitted_line[1]] = splitted_line[0]I'm wondering if we could abstract the concrete distros away by identifying a number of general cases with general parameters, and then include the case as well as the parameters in the yaml.
Metadata
Metadata
Assignees
Labels
No labels