We've got a request (https://issues.redhat.com/browse/RHEL-27937) to extend functionality of autoremove command to also remove optionally weak dependencies as unneeded packages.
The current implementation uses empty job and then we use void solver_get_unneeded(Solver *solv, Queue *unneededq, int filtered); to get unneeded packages. The result is identical if solverflags contains ignorerecommended or not (see https://github.com/rpm-software-management/libdnf/blob/ef8ac7fcedea1ec87dd3149ce1abdf8daeee25b9/libdnf/sack/query.cpp#L2248).
I would like to ask you whether the functionality is supported by libsolv and how we can use it?
I will be happy to provide additional information but I discover that classical testcase does not show unneeded packages. Anyway here is a test case:
repo @System 0 testtags <inline>
#>=Pkg: pkg-A 1.0 1 noarch
#>=Prv: pkg-A = 1.0-1
#>=Rec: pkg-B
#>=Pkg: pkg-B 1.0 1 noarch
#>=Prv: pkg-B = 1.0-1
system x86_64 rpm @System
poolflags implicitobsoleteusescolors whatprovideswithdisabled
solverflags allowdowngrade allowvendorchange ignorerecommended keepexplicitobsoletes bestobeypolicy keeporphans yumobsoletes
job userinstalled pkg pkg-A-1.0-1.noarch@@System
result transaction,problems <inline>
Expectation:
Detect somehow pkg-B as unneeded packages when solver is supposed to ignore weak dependencies. I am completely fine if we will use another method, solver flag to get such information.
We've got a request (https://issues.redhat.com/browse/RHEL-27937) to extend functionality of
autoremovecommand to also remove optionally weak dependencies as unneeded packages.The current implementation uses empty job and then we use
void solver_get_unneeded(Solver *solv, Queue *unneededq, int filtered);to get unneeded packages. The result is identical ifsolverflagscontainsignorerecommendedor not (see https://github.com/rpm-software-management/libdnf/blob/ef8ac7fcedea1ec87dd3149ce1abdf8daeee25b9/libdnf/sack/query.cpp#L2248).I would like to ask you whether the functionality is supported by libsolv and how we can use it?
I will be happy to provide additional information but I discover that classical testcase does not show unneeded packages. Anyway here is a test case:
Expectation:
Detect somehow
pkg-Bas unneeded packages when solver is supposed to ignore weak dependencies. I am completely fine if we will use another method, solver flag to get such information.