FS#9478 - can't remove a package when a group of the same name is installed

Attached to Project: Pacman
Opened by Xavier (shining) - Wednesday, 06 February 2008, 19:09 GMT
Last edited by Xavier (shining) - Thursday, 24 July 2008, 09:23 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To Xavier (shining)
Architecture All
Severity Low
Priority Normal
Reported Version 3.1.1
Due in Version 3.2.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:
It is possible to have both a package and a group of the same name installed.
For example it happened with xorg

> sudo pacman -Qg xorg
xorg xf86-input-keyboard
xorg xf86-input-mouse
xorg xf86-video-vesa
xorg xorg-server
xorg xorg-xinit
xorg xterm

> sudo pacman -Q xorg
xorg 11R7.0-1

> sudo LANG=C pacman -R xorg
:: group xorg:
xf86-input-keyboard xf86-input-mouse xf86-video-vesa xorg-server xorg-xinit xterm
Remove whole content? [Y/n]

We would need a way to choose if we want to remove the package or the group.
For example, pacman -Rg would only try to remove the group.
And pacman -R would try to remove the package first, and if not found, the group.

See also :
http://bbs.archlinux.org/viewtopic.php?pid=303403#p303403
This task depends upon

Closed by  Xavier (shining)
Thursday, 24 July 2008, 09:23 GMT
Reason for closing:  Not a bug
Additional comments about closing:  This bug report is no longer valid in 3.2 where the behavior is reversed. And anyway, it is not a big deal.
Comment by Nagy Gabor (combo) - Tuesday, 26 February 2008, 15:40 GMT
Personally I don't like the proposed fix in the report.

What about target-type modifiers?
With getopt() I have no better idea than the following:
# pacman -R mc -g gnome,devel -p xorg -g multimedia-plugins
[-g <target> indicates group, -p indicates package etc.].
/I don't like this syntax, but I like the idea.../
Comment by Dan McGee (toofishes) - Wednesday, 16 July 2008, 00:27 GMT
What is the status on this after Nagy's recent change to this code?
Comment by Xavier (shining) - Wednesday, 16 July 2008, 06:58 GMT
This patch isn't in master yet but it is already in your working branch so I suppose it will be pushed.
http://www.archlinux.org/pipermail/pacman-dev/2008-July/012315.html

What this does is just reversing the problem. You can't remove a group when a package of the same name is installed.
But probably that is nicer, since it's easier to just remove and reinstall one package than a whole group (or worse, a subset of a group).

So I would just close this, since we can't find a nice way to explicitly specify whether we want to remove a group or a package,
and last Nagy's patch has made this problem less annoying anyway.
Comment by Nagy Gabor (combo) - Wednesday, 16 July 2008, 10:30 GMT
Removing a group is easy "by hand": -Qg + -R, but indeed, this is not nice.
I still vote for dividing group and literal remove (and install).

offtopic: I've just tried -Qqg, I'm pretty sure that we should omit group names here to ease up these "shell hacks": pacman -R `pacman -Qqg xorg`.
Comment by Xavier (shining) - Wednesday, 16 July 2008, 11:25 GMT
> I still vote for dividing group and literal remove (and install).

Do you mean dividing them in pacman interface (in the frontend), or in the code (maybe in the backend?) or both?
Anyway, feel free to start working on this and/or opening the discussion on the ML

> I've just tried -Qqg, I'm pretty sure that we should omit group names here to ease up these "shell hacks": pacman -R `pacman -Qqg xorg`.

The quiet flag is currently not used in -Qg output, feel free to provide a patch implementing that.

Loading...