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

base: Add obsoleters of only latest versions #1994

Merged
merged 1 commit into from
Sep 22, 2023
Merged

Conversation

m-blaha
Copy link
Member

@m-blaha m-blaha commented Sep 21, 2023

Resolves situations where a package is in older version obsoleted, but
there is newer (not obsoleted) version available. This patch covers
installation of group packages and arch specific packages. The rest is in
hawkey library.

Relevant bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=2183279
https://bugzilla.redhat.com/show_bug.cgi?id=2176263

See also: rpm-software-management/libdnf#1624 for
libdnf part of the fix.

@j-mracek
Copy link
Contributor

Note: As a part of the PR there is a commit containing translations. Is it intended?

dnf/base.py Outdated
@@ -1690,7 +1690,13 @@ def trans_install(query, remove_query, comps_pkg, strict):
sltr.set(provides="({} if {})".format(comps_pkg.name, comps_pkg.requires))
else:
if self.conf.obsoletes:
query = query.union(self.sack.query().filterm(obsoletes=query))
# if there are no installed packages in the query, add only
# obsoleters of the latest versions.
Copy link
Contributor

Choose a reason for hiding this comment

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

May I ask you to add information why we should add all obsoletes when installed package is in the selection. It might be worth to document it.

@j-mracek j-mracek self-assigned this Sep 21, 2023
@j-mracek
Copy link
Contributor

The implementation looks good to me

@j-mracek
Copy link
Contributor

@m-blaha All tests passed, the merge is only blocked by update of a note in the code and removal of a commit with translation (rebase might help).

@m-blaha m-blaha force-pushed the mblaha/obsolete-latest branch from 8b39a0e to 337b30d Compare September 21, 2023 10:25
Resolves situations where a package is in older version obsoleted, but
there is newer (not obsoleted) version available.
This patch covers installation of group packages and arch specific
packages. The rest is in hawkey library.

Relevant bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=2183279
https://bugzilla.redhat.com/show_bug.cgi?id=2176263
@m-blaha m-blaha force-pushed the mblaha/obsolete-latest branch from 337b30d to c9411de Compare September 21, 2023 10:33
@j-mracek
Copy link
Contributor

LGTM, tested locally

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

@j-mracek j-mracek merged commit a9593d2 into master Sep 22, 2023
@j-mracek j-mracek deleted the mblaha/obsolete-latest branch September 22, 2023 08:27
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