zif icon indicating copy to clipboard operation
zif copied to clipboard

remove-with-deps does not work as it should

Open mustafa1024m opened this issue 13 years ago • 10 comments

Hi, I've been trying this and it is FAST, thank you. One thing that bothers me is not removing dependencies after removing the package that installed them, there is an option in yum "clean_requirements_on_remove" that does this, hope you can implement it, regards

mustafa1024m avatar Dec 18 '12 05:12 mustafa1024m

On 18 December 2012 05:57, mustafaa [email protected] wrote:

One thing that bothers me is not removing dependencies after removing the package that installed them, there is an option in yum "clean_requirements_on_remove" that does this, hope you can implement it, regards

Already done, although it's not well tested. Either set clean_requirements_on_remove in /etc/yum.conf or use "zif remove-with-deps foo bar baz"

Richard.

hughsie avatar Dec 18 '12 08:12 hughsie

Closing.

elad661 avatar Dec 18 '12 09:12 elad661

If you mean that setting it in /etc/yum.conf makes "yum" remove dependencies, you are right and I know it. But if you mean that setting it in /etc/yum.conf makes "zif" remove dependencies, this is not the case here, however, remove-with-deps works but not as good as yum's, I hope you add it as an option in /etc/zif.conf or inherit it from /etc/yum.conf (and after enough testing make it default, nobody loves unneeded orphan packages).

I also retried these tests (originally by Chris): http://blog.christophersmart.com/2010/11/11/testing-yums-autoremove-orphaned-deps-feature/ and I found:

  1. In the first case (Single package with dependencies), remove-with-deps works fine.
  2. In the second case (Packages with shared dependencies), remove-with-deps tries to (force remove) the dependency, thus removing other packages depending on the dependency (e.g. removing vlc wants to remove libcaca even if it is still used by mplayer, thus it removes mplayer too).
  3. The third case (Removing a package’s dependency) doesn't correctly too.

hope you fix those issues. Regards

mustafa1024m avatar Dec 19 '12 05:12 mustafa1024m

On 19 December 2012 05:52, Mustafa Muhammad [email protected] wrote:

  1. In the second case (Packages with shared dependencies), remove-with-deps tries to (force remove) the dependency, thus removing other packages depending on the dependency (e.g. removing vlc wants to remove libcaca even if it is still used by mplayer, thus it removes mplayer too).

Right, so something like this would expose the bug in "make check":

Install a package that drags in two deps, install another package

that also requires the fist dep, and then remove the first package --

the shared dep should not be removed, nor the second package

config archinfo=i386 clean_requirements_on_remove=1 history_db=/tmp/history.db

local

remote vlc;0:0.1.0-1;i386;meta Requires libcaca libvlc mplayer;0:0.1.0-1;i386;meta Requires libcaca libmplayer libcaca;0:0.1.0-1;i386;meta libvlc;0:0.1.0-1;i386;meta libmplayer;0:0.1.0-1;i386;meta

transaction install vlc install mplayer

result vlc;0:0.1.0-1;i386;meta libcaca;0:0.1.0-1;i386;meta libvlc;0:0.1.0-1;i386;meta mplayer;0:0.1.0-1;i386;meta libmplayer;0:0.1.0-1;i386;meta

----------------------------------------------------------------------

flush

----------------------------------------------------------------------

local vlc;0:0.1.0-1;i386;meta Requires libcaca libvlc mplayer;0:0.1.0-1;i386;meta Requires libcaca libmplayer libcaca;0:0.1.0-1;i386;meta libvlc;0:0.1.0-1;i386;meta libmplayer;0:0.1.0-1;i386;meta

transaction remove vlc

result mplayer;0:0.1.0-1;i386;meta libcaca;0:0.1.0-1;i386;meta libmplayer;0:0.1.0-1;i386;meta


Richard

hughsie avatar Dec 19 '12 10:12 hughsie

I've merged this into master:

commit 3f218a02ed7066d7cc48edeb88b80e1723b23e6c Author: Richard Hughes [email protected] Date: Wed Dec 19 13:07:23 2012 +0000

Fix 'zif remove-with-deps' to not remove user-action packages that also require an installed provide

This fixes item 1 and 2 as described in:
http://blog.christophersmart.com/2010/11/11/testing-yums-autoremove-orphaned-deps-feature/

Resolves some of the issues in https://github.com/hughsie/zif/issues/17

hughsie avatar Dec 19 '12 13:12 hughsie

Thanks Richard, do you think you can fix the other item too before F18? This would be great.

mustafa1024m avatar Jan 02 '13 13:01 mustafa1024m

No, it's quite a lot harder. I'd have to refactor the dep-chain logic to be able to save the state before doing each cycle. It's quite a factorial problem. I've got some test code, but it's not working very well.

hughsie avatar Jan 02 '13 14:01 hughsie

Thanks again, I'll keep waiting.

mustafa1024m avatar Jan 02 '13 20:01 mustafa1024m

Oops, didn't mean to close that, sorry

elad661 avatar Jan 24 '13 12:01 elad661

Any update on the matter? Before F20?

mustafa1024m avatar Oct 27 '13 08:10 mustafa1024m