FS#11337 - Pacman: Option to install optional dependencies with package.

Attached to Project: Pacman
Opened by Xyne (Xyne) - Friday, 29 August 2008, 02:05 GMT
Last edited by Dan McGee (toofishes) - Sunday, 31 August 2008, 23:47 GMT
Task Type Feature Request
Category General
Status Unconfirmed
Assigned To No-one
Architecture All
Severity Very Low
Priority Normal
Reported Version 3.2.1
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 51
Private No


It would be nice to have an option to either install all optional dependencies or be prompted for each one when installing packages.

--optdeps all

Install all optdeps.

--optdeps prompt

If a package contains optional dependencies, prompt the user with "Install optional dependencies for <pkgname>? (all/prompt/none)
If the user chooses "prompt", prompt with an "install <optdepname>? (y/n)" message for each optional dependency in the given package.

--optdeps none

Only list the optional dependencies without installing them (default when no "--optdeps" option is passed).

Maybe use "-o" as an abbreviation for "--optdeps" and "a","p", and "n" as abbreviations for "all", "prompt", and "none", resp.
This task depends upon

Comment by Roman Kyrylych (Romashka) - Friday, 29 August 2008, 06:23 GMT
I like it
Comment by Xavier (shining) - Friday, 29 August 2008, 07:09 GMT
If no one implements it in pacman, this could be a good candidate for a new yaourt feature :)
Comment by Dan McGee (toofishes) - Sunday, 31 August 2008, 23:47 GMT
I agree we could usesomething to make optdepend install easier, but I hate the command line goo. We need something easier than this.
Comment by Henning Garus (garns) - Saturday, 06 September 2008, 16:46 GMT
What about handling this pretty much like groups?:

$ LANG=C sudo ./pacman -S wine
warning: wine-1.1.4-1 is up to date -- reinstalling
Optional dependencies for wine
cups: printing support
sane: scanners support
libgphoto2: digital cameras support
alsa-lib: sound support
giflib: GIF images support
libjpeg: JPEG images support
libpng: PNG images support
:: Install optional dependencies? [Y/n] y
:: Install all optional dependencies? [Y/n] n
:: Install optional dependency cups? [Y/n] n
:: Install optional dependency sane? [Y/n] n
:: Install optional dependency libgphoto2? [Y/n] n
:: Install optional dependency alsa-lib? [Y/n] y
:: Install optional dependency giflib? [Y/n] n
:: Install optional dependency libjpeg? [Y/n] n
:: Install optional dependency libpng? [Y/n] y
warning: alsa-lib-1.0.17a-1 is up to date -- reinstalling
warning: libpng-1.2.31-1 is up to date -- reinstalling
resolving dependencies...
looking for inter-conflicts...

Targets (3): wine-1.1.4-1 alsa-lib-1.0.17a-1 libpng-1.2.31-1

Maybe with an option in pacman.conf to switch between this and printing only. And filtering the optdepends which are already installed.

Is sync_trans the right place to do this?
Comment by Xyne (Xyne) - Saturday, 06 September 2008, 17:20 GMT
Handling it like groups works as well, although it would be nice to have a command-line option to tell it to either install or skip everything in some cases.
Comment by Karol Błażewicz (karol) - Saturday, 03 September 2011, 19:45 GMT
Comment by ifaigios (ifaigios) - Thursday, 07 February 2013, 14:39 GMT
Is this going to be included with pacman-4.1?
Comment by mark (mmm) - Tuesday, 02 April 2013, 14:16 GMT
Xyne, please have a look at my feature request https://bugs.archlinux.org/task/34551 which builds and I think improves this attitude.
Also, do you still have sources for your metapax project? I found it mentioned, but links are dead. I found only makedep.
Comment by Patrick Steinhardt (pks) - Monday, 03 June 2013, 21:41 GMT
I've implemented the option to install optdepends re-using group install handling. While the patch most likely still needs some love it currently works. There might still be issues with circular optdeps, though, but I didn't check that yet. Feel free to voice your opinion.
Comment by Chris Clark (clark800) - Saturday, 08 March 2014, 23:24 GMT
My feature request was marked as duplicate: https://bugs.archlinux.org/task/38867 Though it is not quite a duplicate, it can be combined with this feature if there were an additional option like "--optdeps ignore" that skips installation AND suppresses the output of optional dependencies.
Comment by mattia (nTia89) - Wednesday, 14 January 2015, 10:05 GMT
I want to share my experience about this "problem"