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

PackageQuery: Source rpms do not upgrade binary ones #1310

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

m-blaha
Copy link
Member

@m-blaha m-blaha commented Mar 14, 2024

Noarch packages can be used to upgrade any binary packages, but not source
packages. Fixes incorrect filter_upgrades() behaviour where src packages
were returned as upgrade candidates for noarch packages.

Tests adjustment: rpm-software-management/ci-dnf-stack#1472

m-blaha added 2 commits March 14, 2024 10:02
Noarch packages can be used to upgrade any binary packages, but not
source packages.
Fixes incorrect filter_upgrades() behaviour where src packages were
returned as upgrade candidates for noarch packages.
Now filter_upgrades does not return source packages as upgrade
candidates to binary packages.
@m-blaha m-blaha marked this pull request as ready for review March 14, 2024 09:35
@j-mracek j-mracek self-assigned this Mar 15, 2024
Copy link
Contributor

@j-mracek j-mracek left a comment

Choose a reason for hiding this comment

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

LGTM

}
if (updated->arch != ARCH_NOARCH && solvable->arch != ARCH_NOARCH) {
continue;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM, this condition is really good one. Interesting thing is that this condition will still create incorrect result for packages with incompatible architecture.

When installed package is pkgA-1-1.noarch and available are pkgA-2-1.x86_64 and pkgA-2-1.s390 both will be considered as upgrades regardless of system architecture. Fortunately it requires 2 rare conditions. I do not think that we should resolve the issue, because for the final decision we have a solver.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, although the .s390 version is not installable, it still is (unlike the source rpm) a possible upgrade to a .noarch package. It depends on what we want from filter_upgrades() to exactly do... Btw we need to document this filter (I've just checked the package_query.hpp header file and found that the documentation is virtually missing).

@j-mracek j-mracek added this pull request to the merge queue Mar 18, 2024
Merged via the queue into main with commit 1234667 Mar 18, 2024
14 of 22 checks passed
@j-mracek j-mracek deleted the mblaha/dnf5-what-upgrades-src branch March 18, 2024 09:58
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.

2 participants