openSUSE / libsolv

Library for solving packages and reading repositories
http://en.opensuse.org/openSUSE:Libzypp_satsolver
Other
509 stars 151 forks source link

Using old version to satisfy dependency #536

Closed kontura closed 11 months ago

kontura commented 12 months ago

This passes:

repo @System 0 testtags <inline>
#>=Pkg: krb5-libs 1.18.2 22.el8_7 x86_64
#>=Prv: krb5-libs(x86-64) = 1.18.2-22.el8_7

repo available 0 testtags <inline>
#>=Pkg: ipa-client 4.9.11 5.el8 x86_64
#>=Req: krb5-pkinit-openssl
#>
#>=Pkg: krb5-libs 1.18.2 25.el8_8 x86_64
#>=Prv: krb5-libs(x86-64) = 1.18.2-25.el8_8
#>
#>=Pkg: krb5-pkinit 1.18.2 25.el8_8 x86_64
#>=Req: krb5-libs(x86-64) = 1.18.2-25.el8_8
#>=Prv: krb5-pkinit-openssl = 1.18.2-25.el8_8
#>
#>=Pkg: krb5-pkinit 1.18.2 22.el8_7 x86_64
#>=Req: krb5-libs(x86-64) = 1.18.2-22.el8_7
#>=Prv: krb5-pkinit-openssl = 1.18.2-22.el8_7

system x86_64 rpm @System

job install oneof ipa-client-4.9.11-5.el8.x86_64@available

result transaction,problems <inline>
#>install ipa-client-4.9.11-5.el8.x86_64@available
#>install krb5-pkinit-1.18.2-22.el8_7.x86_64@available

I think it would be more appropriate if the result was:

result transaction,problems <inline>
#>install ipa-client-4.9.11-5.el8.x86_64@available
#>install krb5-pkinit-1.18.2-25.el8_8.x86_64@available
#>upgrade krb5-libs-1.18.2-22.el8_7.x86_64@@System krb5-libs-1.18.2-25.el8_8.x86_64@available
mlschroe commented 11 months ago

The solver tries to change as little of the system as possible. I.e. it will select the highest versions of the job you give to it and then try to keep your installed packages. That's usually the expectation of the user as well.

There's a different mode where it tries to use the newest versions: SOLVER_FLAG_FOCUS_BEST. Thus it will update krb5-libs if you add

solverflags focusbest

to your testcase.

mlschroe commented 11 months ago

(I'm not proposing to make this the default in dnf, though.)

kontura commented 11 months ago

I see, we will look into that. Thanks.