Coder Social home page Coder Social logo

Comments (7)

mlschroe avatar mlschroe commented on June 6, 2024

libsolv has a mechanism for dropping conflicting packages with SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL, but it relies on the 3rd party repos not being enabled, i.e. the 3rd party packages must be "orphaned".

It seems that you want some method to tell the solver "you're free to drop those installed packages if they get in the way", i.e. like allowuninstall (aka allowerasing) but just for a specific set of packages.

from libsolv.

kparal avatar kparal commented on June 6, 2024

From a high-level perspective, I think we would like to cover three basic cases during N -> N+1 system upgrades:

  1. third-party repos exist for N+1 and contain package updates with non-problematic dependencies: In this case we want to upgrade those packages together with the rest of the system.
  2. third-party repos don't exist for N+1 and the current packages have problematic dependencies, meaning they prevent current packages from upgrading. Alternatively the N+1 repos do exist, but the package updates still have problematic dependencies: In this case we want to prioritize packages from our official repositories at the expense of third-party repositories (removing their packages if needed).
  3. third-party repos don't exist for N+1 (or the packages were not installed from any repository at all), but they don't cause any problematic dependencies while the rest of the system upgrades to N+1. In that case we want to keep those packages installed and don't remove them.

I'm not sure how much of it is related to libsolv and what is a higher-level problem, so please forgive me if I'm completely off-topic here.

from libsolv.

jsilhan avatar jsilhan commented on June 6, 2024

libsolv has a mechanism for dropping conflicting packages with SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL, but it relies on the 3rd party repos not being enabled, i.e. the 3rd party packages must be "orphaned".

We would like to keep them if possible.

It seems that you want some method to tell the solver "you're free to drop those installed packages if they get in the way", i.e. like allowuninstall (aka allowerasing) but just for a specific set of packages.

Yes, that would resolve 1), 2), 3) specifications. The new Repo int attribute or Pool map attribute would be sufficient. Thanks.

from libsolv.

mlschroe avatar mlschroe commented on June 6, 2024

I added the SOLVER_ALLOWUNINSTALL job type, please check if it meets your requirements.

from libsolv.

jsilhan avatar jsilhan commented on June 6, 2024

I am struggling with understanding the semantic of SOLVER_ALLOWUNINSTALL.

If pkg D is not allowed to be uninstalled then it will fail. Fine.

repo system 0 testtags <inline>
#>=Pkg: A 1 1 x86_64
#>=Pkg: B 1 1 x86_64
#>=Pkg: C 1 1 x86_64
#>=Pkg: D 1 1 x86_64
repo fedora 0 testtags <inline>
#>=Pkg: A 1 2 x86_64
#>=Pkg: B 1 2 x86_64
#>=Con: D
system x86_64 rpm system
solverflags keeporphans
job distupgrade all packages
result transaction,problems <inline>
#>erase D-1-1.x86_64@system
#>problem bbe6eb7e info package B-1-2.x86_64 conflicts with D provided by D-1-1.x86_64
#>problem bbe6eb7e solution 20a5cb70 erase D-1-1.x86_64@system
#>problem bbe6eb7e solution 81759705 allow B-1-1.x86_64@system

I allow him to be erased. Works as expected.

repo system 0 testtags <inline>
#>=Pkg: A 1 1 x86_64
#>=Pkg: B 1 1 x86_64
#>=Pkg: C 1 1 x86_64
#>=Pkg: D 1 1 x86_64
repo fedora 0 testtags <inline>
#>=Pkg: A 1 2 x86_64
#>=Pkg: B 1 2 x86_64
#>=Con: D
system x86_64 rpm system
solverflags keeporphans
job allowuninstall pkg D-1-1
job distupgrade all packages
result transaction,problems <inline>
#>erase D-1-1.x86_64@system
#>upgrade A-1-1.x86_64@system A-1-2.x86_64@fedora
#>upgrade B-1-1.x86_64@system B-1-2.x86_64@fedora

But when I add pkg B to allow_uninstall set, the B will not get upgraded anymore. I expect it to work like in the previous example.

repo system 0 testtags <inline>
#>=Pkg: A 1 1 x86_64
#>=Pkg: B 1 1 x86_64
#>=Pkg: C 1 1 x86_64
#>=Pkg: D 1 1 x86_64
repo fedora 0 testtags <inline>
#>=Pkg: A 1 2 x86_64
#>=Pkg: B 1 2 x86_64
#>=Con: D
system x86_64 rpm system
solverflags keeporphans
job allowuninstall pkg B-1-1
job allowuninstall pkg D-1-1
job distupgrade all packages
result transaction,problems <inline>
#>upgrade A-1-1.x86_64@system A-1-2.x86_64@fedora

From docs: Allow the solver to deinstall the matching installed packages if they get into the way of resolving a dependency. This is like the SOLVER_FLAG_ALLOW_UNINSTALL flag, but limited to a specific set of packages.
why at some point SOLVER_FLAG_ALLOW_UNINSTALL flag protects packages rather than letting them to be erased?

from libsolv.

mlschroe avatar mlschroe commented on June 6, 2024

I think this is already fixed with the latest commits. (Especially 80ddee1)

from libsolv.

jsilhan avatar jsilhan commented on June 6, 2024

Confirming that it works now, thanks.

from libsolv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.