Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include configuration for how to update versions into yaml file #633

Open
mbuechse opened this issue Aug 18, 2023 · 0 comments
Open

Include configuration for how to update versions into yaml file #633

mbuechse opened this issue Aug 18, 2023 · 0 comments

Comments

@mbuechse
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant