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

Support ubuntu jammy, noble, and oracular with their appropriate qt #791

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adamlamar
Copy link
Collaborator

@adamlamar adamlamar commented Dec 19, 2024

Adds package profiles for various versions of ubuntu - jammy, noble, oracular, and uses their appropriate versions of Qt.

When specifying packages, you can now use the LSB codename in the PACKAGE_NAME_MAPPERS dictionary, giving more control about whether (say) a qt package should be installed as version 5 or 6. For example ubuntu_jammy_native_dyn and ubuntu_noble_native_dyn are now checked to find the package list. Similarly debian_bookworm_native_dyn could be used, but I didn't change any existing package lists.

@adamlamar adamlamar marked this pull request as ready for review December 19, 2024 05:06
@kelson42
Copy link
Contributor

@adamlamar Thank you for the PR. @veloman-yunkan will have a look to this PR this WE.

Comment on lines 127 to 140
for config in ConfigInfo.all_running_configs.values():
# get {host}_{config} packages
mapper_name = "{host}_{config}".format(
host=neutralEnv("distname"), config=config
)
package_name_mapper = PACKAGE_NAME_MAPPERS.get(mapper_name, {})
packages_list += package_name_mapper.get("COMMON", [])
# get {host}_{codename}_{config} packages
mapper_name = "{host}_{codename}_{config}".format(
host=neutralEnv("distname"), codename=neutralEnv("codename"), config=config
)
package_name_mapper = PACKAGE_NAME_MAPPERS.get(mapper_name, {})
packages_list += package_name_mapper.get("COMMON", [])

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the code duplication introduced here and in the other change in this (_get_packages()) function.

You can avoid it with the help of an auxiliary function _get_mapper_names_for_config(config):

def _get_mapper_names_for_config(config):
    host = neutralEnv("distname")
    codename = neutralEnv("codename")
    return ( f"{host}_{config}", f"{host}_{codename}_{config}" )

Then your code here will turn into:

        for config in ConfigInfo.all_running_configs.values():
            for mapper_name in _get_mapper_names_for_config(config):
                package_name_mapper = PACKAGE_NAME_MAPPERS.get(mapper_name, {})
                packages_list += package_name_mapper.get("COMMON", [])

Comment on lines +155 to +167

# get {host}_{codename}_{config} packages
mapper_name = "{host}_{codename}_{config}".format(
host=neutralEnv("distname"), codename=neutralEnv("codename"), config=configName
)
package_name_mapper = PACKAGE_NAME_MAPPERS.get(mapper_name, {})
packages = package_name_mapper.get(builderName)
if packages:
to_drop.append(builderDef)
if packages is not True:
# True means "assume the dependency is install but do not try to install anything for it"
packages_list += packages

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of this code duplication taking advantage of _get_mapper_names_for_config() like proposed in the previous comment.

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

Successfully merging this pull request may close these issues.

3 participants