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

apps: Consider ID_LIKE for mapping AppStream data packages #19283

Merged
merged 3 commits into from
Sep 7, 2023

Conversation

martinpitt
Copy link
Member

With only looking at aos-release's ID field, we are missing out a lot of derivatives, such as CentOS Stream, Rocky, or Debian-likes. Consider ID_LIKE as well to fix that.

E.g. on Ubuntu, ID_LIKE is "debian", on CentOS it's "rhel fedora", on Rocky Linux it's "rhel centos fedora".

Use that to clean up the manifest map, as Ubuntu and RHEL are now redundant.


Spotted in #19281 (comment)

@martinpitt
Copy link
Member Author

@leomoty do you mind testing this? It should fix metapackage installation on Rocky with the Refresh button for you.

@leomoty
Copy link
Contributor

leomoty commented Sep 5, 2023

@leomoty do you mind testing this? It should fix metapackage installation on Rocky with the Refresh button for you.

Yep, works as intended, albeit we might need to double check the text later, for me it just flickered for about a second. Could be a side effect of my CSS changes in the previous PR.

Comment on lines +109 to +111
if (val[c]) {
val = val[c];
return true;
Copy link
Member Author

Choose a reason for hiding this comment

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

Added a test to cover this.

@martinpitt

This comment was marked as resolved.

mvollmer
mvollmer previously approved these changes Sep 6, 2023
Copy link
Member

@mvollmer mvollmer left a comment

Choose a reason for hiding this comment

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

Thanks!

@martinpitt martinpitt force-pushed the apps-os-mapping branch 2 times, most recently from d006eb6 to 4dc8ffc Compare September 7, 2023 04:32
@martinpitt martinpitt added the release-blocker Targetted for next release label Sep 7, 2023
test/common/testlib.py Outdated Show resolved Hide resolved
If the daemon crashes and goes into a "failed" state, it breaks all
subsequent tests. Avoid that.
Use f-strings, and drop the unnecessary (and possibly dangerous) `rm -r`
option on restoration. This function already does not work for
directories.
With only looking at aos-release's `ID` field, we are missing out a lot
of derivatives, such as CentOS Stream, Rocky, or Debian-likes. Consider
ID_LIKE as well to fix that.

E.g. on Ubuntu, `ID_LIKE` is "debian", on CentOS it's "rhel fedora", on
Rocky Linux it's "rhel centos fedora".

Use that to clean up the manifest map, as Ubuntu and RHEL are now
redundant.

testBasic covers the "direct package name" case in the manifest. Add
a new testOsMap test to check the distroname → packagename map that we
use in real life.
function get_config(name, distro_id, def) {
function get_config(name, os_release, def) {
// ID is a single value, ID_LIKE is a list
const os_list = [os_release.ID || "", ...(os_release.ID_LIKE || "").split(/\s+/)];
Copy link
Contributor

Choose a reason for hiding this comment

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

This added line is not executed by any test. Details

@martinpitt martinpitt merged commit 7bbf916 into cockpit-project:main Sep 7, 2023
33 checks passed
@martinpitt martinpitt deleted the apps-os-mapping branch September 7, 2023 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-blocker Targetted for next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants