You are not logged in.

#1 2012-05-23 07:06:05

cdwijs
Member
Registered: 2010-04-24
Posts: 310

Pacman: check if optional deps are already installed?

Hi All,

When I install a package, pacman suggest that I install other packages as optional dependensies like this:

(11/11) installing totem                                                                                   [###############################################################] 100%
Optional dependencies for totem
    gstreamer0.10-ugly-plugins: Extra media codecs
    gstreamer0.10-bad-plugins: Extra media codecs
    gstreamer0.10-ffmpeg: Extra media codecs
    lirc-utils: Infrared Remote Control plugin
    libepc: Publish Playlist plugin
    libgdata: YouTube Browser plugin
    bluez: Bemused plugin
    grilo-plugins: Browse sidebar (remote media)
    pyxdg: opensubtitles plugin

Some of these are already installed on my system. I think it would be usefull that pacman checks if these are already installed. I would like something like this output:

(11/11) installing totem                                                                                   [###############################################################] 100%
Optional dependencies for totem
    gstreamer0.10-ugly-plugins: Extra media codecs (*installed*)
    gstreamer0.10-bad-plugins: Extra media codecs
    gstreamer0.10-ffmpeg: Extra media codecs
    lirc-utils: Infrared Remote Control plugin
    libepc: Publish Playlist plugin (*installed*)
    libgdata: YouTube Browser plugin
    bluez: Bemused plugin
    grilo-plugins: Browse sidebar (remote media)
    pyxdg: opensubtitles plugin

What are your thoughts on the subject?

Best regards,
Cedric

Offline

#2 2012-05-23 07:09:37

Shark
Member
From: /dev/zero
Registered: 2011-02-28
Posts: 686

Re: Pacman: check if optional deps are already installed?

That would be great. It would be also great that the optional dependencies would be deleted if the explicitly installed package is gone. I don't know why this feature isn't already integrated. Does somebody have patch?


If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau

Registered Linux User: #559057

Offline

#3 2012-05-23 07:35:27

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Re: Pacman: check if optional deps are already installed?

cdwijs: Create a feature request here: https://bugs.archlinux.org/index.php?pr … x&switch=1

Offline

#4 2012-05-23 07:49:46

Shark
Member
From: /dev/zero
Registered: 2011-02-28
Posts: 686

Re: Pacman: check if optional deps are already installed?

Here is a similar request posted in 2009.


If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau

Registered Linux User: #559057

Offline

#5 2012-05-23 09:10:46

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Pacman: check if optional deps are already installed?

Check the pacman-dev mailing list also, there may have been additional relevant discussion there.

And at the risk of stating the obvious, the best way to get a response from the devs is to submit a patch yourself.

Last edited by tomk (2012-05-23 10:01:01)

Offline

#6 2012-05-23 09:24:54

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,672
Website

Re: Pacman: check if optional deps are already installed?

There is actually a patchset floating around that completely overhauls the handling of optdepends.  It needs some work to get merged....

Offline

#7 2012-05-23 16:20:11

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: Pacman: check if optional deps are already installed?

Shark wrote:

That would be great. It would be also great that the optional dependencies would be deleted if the explicitly installed package is gone. I don't know why this feature isn't already integrated. Does somebody have patch?

I, for one, disagree. You see, hard dependencies are justified (as in there are some guidelines as to how assign them), optdeps are not (there can be cross-repo optdeps from lower-level repo to a higher-level one; if you promote optdeps to real deps, there can be dependency cyces, etc.). In pacman, otdeps = comments. So, I would really prefer to keep it that way.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#8 2012-05-23 16:25:02

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: Pacman: check if optional deps are already installed?

Allan wrote:

There is actually a patchset floating around that completely overhauls the handling of optdepends.  It needs some work to get merged....

That is nice to read. So far all I though whenever reading the output was: "Nice, more bogus crap from the optdepends array…"

:-)

Offline

#9 2012-05-23 19:00:54

Shark
Member
From: /dev/zero
Registered: 2011-02-28
Posts: 686

Re: Pacman: check if optional deps are already installed?

Leonid.I wrote:
Shark wrote:

That would be great. It would be also great that the optional dependencies would be deleted if the explicitly installed package is gone. I don't know why this feature isn't already integrated. Does somebody have patch?

I, for one, disagree. You see, hard dependencies are justified (as in there are some guidelines as to how assign them), optdeps are not (there can be cross-repo optdeps from lower-level repo to a higher-level one; if you promote optdeps to real deps, there can be dependency cyces, etc.). In pacman, otdeps = comments. So, I would really prefer to keep it that way.

It could be implemented some security measures that optdepends wouldn't be removed if this optdepends are tied to other packages too - like real dependencies are. It could be implemented the same system for optdepends as is for real dependencies.


If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau

Registered Linux User: #559057

Offline

#10 2012-05-23 20:34:29

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,672
Website

Re: Pacman: check if optional deps are already installed?

If you want to know what has been implemented (but needs revision before merging...)

https://wiki.archlinux.org/index.php/Us … OptDepends

Offline

#11 2012-05-24 13:57:53

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: Pacman: check if optional deps are already installed?

You can use this or similar to check right now:

pacman -T $(expac -Q '%o' totem)

Last edited by Mr.Elendig (2012-05-27 13:44:17)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#12 2012-05-26 16:42:43

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: Pacman: check if optional deps are already installed?

Allan wrote:

If you want to know what has been implemented (but needs revision before merging...)

https://wiki.archlinux.org/index.php/Us … OptDepends

optdepends can be removed with -Rs [done] 

I don't mean to criticize especially if I haven't done anything about it, but this seems like an overkill. As i said, I don't think one should treat optdeps at the same level as hard deps. Perhaps, -Rso would be an alternative.

For example, suppose that some package X optdepends on a package Y from base. Package Y is not listed as a dep for any of the packages (that's the guideline?). Then, removing X will get rid of Y and break the system. Another example is less severe: X optdepends on Y, but I want to remove X (including its hard deps) but want to keep Y.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#13 2012-05-26 22:38:14

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,672
Website

Re: Pacman: check if optional deps are already installed?

Umm...  you do know the difference between packages installed explicitly and as dependencies?

Offline

#14 2012-05-27 08:01:18

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: Pacman: check if optional deps are already installed?

This sounds like optdepends marked as dependencies won't show up in -Qdt anymore.

Offline

#15 2012-05-27 12:57:27

Pajaro
Member
Registered: 2004-04-21
Posts: 884

Re: Pacman: check if optional deps are already installed?

Mr.Elendig wrote:

You can use this or similar to check right now:

pacman -T $(expac -Q '%O' totem | cut -d':' -f1)

Or if you want the list for all installed packages

for i in $(pacman -Q|sed 's/\ .*//'); do ODS=$(pacman -T $(expac -Q '%O' $i | cut -d':' -f1)); if [ "$ODS" ]; then echo $i: $ODS; fi; done

Offline

#16 2012-05-27 13:05:44

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: Pacman: check if optional deps are already installed?

Pajaro wrote:
for i in $(pacman -Q|sed 's/\ .*//'); do ODS=$(pacman -T $(expac -Q '%O' $i | cut -d':' -f1)); if [ "$ODS" ]; then echo $i: $ODS; fi; done

rtfm and see what pacman -Qq does smile


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#17 2012-05-27 13:14:52

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Pacman: check if optional deps are already installed?

And what expac's %o does...

Offline

#18 2012-05-27 17:34:58

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: Pacman: check if optional deps are already installed?

Allan wrote:

Umm...  you do know the difference between packages installed explicitly and as dependencies?

OK... fair enough.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

Board footer

Powered by FluxBB