-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
base: main
Are you sure you want to change the base?
Conversation
559fe8b
to
7cd3ee1
Compare
@adamlamar Thank you for the PR. @veloman-yunkan will have a look to this PR this WE. |
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", []) | ||
|
There was a problem hiding this comment.
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", [])
|
||
# 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 | ||
|
There was a problem hiding this comment.
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.
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 thePACKAGE_NAME_MAPPERS
dictionary, giving more control about whether (say) a qt package should be installed as version 5 or 6. For exampleubuntu_jammy_native_dyn
andubuntu_noble_native_dyn
are now checked to find the package list. Similarlydebian_bookworm_native_dyn
could be used, but I didn't change any existing package lists.