You are not logged in.

#1 2012-10-10 10:38:51

gravitezero
Member
Registered: 2012-05-03
Posts: 11

[SOLVED] How to properly install optionnal dependencies ?

Hi,

As stated in the title, I don't know how to install optionnal dependencies : (let's take an example)
I noticed that with libva comes two optional dependencies libva-intel-driver and libva-vdpau-driver, and as I have an intel graphic card, I would like to install libva-intel-driver.
But to keep my package tree quite clean, I would like to install it as a dependency of libva, this way, if someday I want to remove libva, libva-intel-driver will be removed too.

In the pacman manual, the option --asdeps seems to be useful to install a package as a dependency (but it doesn't seems to need to specify which package it is a dependency for).

So my question is, does this mean that libva-intel-driver will be removed when I don't need libva anymore ?
And more generally, how pacman manage dependency ?

As a matter of fact, I tried to install and then remove libva-intel-driver, but it never said that libva might need it.

tl;dr : I want to install an optionnal dependencies exactly like a regular dependencies would be installed : how could I do that ?

Edit:
the answer is here : https://wiki.archlinux.org/index.php/Us … OptDepends

Last edited by gravitezero (2012-10-10 12:04:25)

Offline

#2 2012-10-10 11:20:32

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,520
Website

Re: [SOLVED] How to properly install optionnal dependencies ?

If you install it with --asdeps, which package it is a dependency for is listed in the packages info file that goes into pacman's database.

Imagine you have packages A B and C, C is a dependency of both A and B, but for whatever reason you install C first with "--asdeps", then you install A and B.  If you later remove A with "pacman -R A" no dependencies will be removed, but if you use "pacman -Rsn A" A will be removed as will all of it's dependencies that are not needed by any other package.  So in this case C would still not be removed as B still needs it.  If you then "pacman -Rsn B" B and all it's dependencies including C would be removed.

That is how it works for normal dependencies.  I don't believe optional dependencies have database entries in the "required by" field as they are not required, they are optional.  So if C were only an optional dependency of A and B, it would never be removed by removing A and/or B (AFAIK).

----

If you install libva-intel-driver with "--asdeps" then it will likely show up in "pacman -Qdt" output.  If you later install anything that has libva-intel-driver as a regular dependency, then later remove that package with "pacman -Rsn" libva-intel-driver will be taken away with it - it is doubtful you would want this.  So don't install optional dependencies "--asdeps"

They are optional, you are opting for them, install them normally.

----

Alternately, and as a direct answer to your real question, I believe the only way to do with would be to modify the package info of libva to switch libva-intel-driver from optional to regular dependency.  This would be easy to do, but I don't know if it's easy to automate, nor would it survive udates to libva, it'd have to be redone.

Last edited by Trilby (2012-10-10 11:21:06)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#3 2012-10-10 11:25:57

Awebb
Member
Registered: 2010-05-06
Posts: 4,133

Re: [SOLVED] How to properly install optionnal dependencies ?

There already is a thread: https://bbs.archlinux.org/viewtopic.php?id=149787
Leading to this bug report: https://bugs.archlinux.org/task/30074
So the answer is: Not yet at all but in the foreseable future. If you really need this for some packages, you could rebuild them using abs, adding the optdepends to the depends. And please, if you have a good idea, look for one of the bug reports and share your ideas. I'd say the best way to get Allan to implement something, is giving him input.

Now that I have been helpful and all, I want you to know, that this entire "tl;dr" business, that infects the web from reddit, is percieved to be insulting by quite a few intelligent people. It creates the feeling, that your text before that tag is irrelevant. Instead you should chose your words carefully in the actual text.

Offline

#4 2012-10-10 11:28:59

gravitezero
Member
Registered: 2012-05-03
Posts: 11

Re: [SOLVED] How to properly install optionnal dependencies ?

I want them because I installed libva (which is required by ffmpeg, which is required by ?? probably vlc).
But I really don't have a good memory, so I would like my package tree to remember I wanted this package because of libva.

I think I will try to change the PKGBUILD, but I am pretty sure it will break on next update.
Should I post a bug report ?

Offline

#5 2012-10-10 11:35:06

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,520
Website

Re: [SOLVED] How to properly install optionnal dependencies ?

You wouldn't necesarily have to rebuild.  Just uncompress the package and add a depend line to the .PKGINFO file in the packages root, recompress, then install with "pacman -U".

Edit: A bug report seems inappropriate.  If feature requests go on the same tracker, a feature request would make sense as that's what this is.  There is no bug when a tool does not do something it was never intended to do.  EDIT AGAIN: As Awebb pointed out there already is a bug report.  While I stand by my logic that I don't think it should be called a bug, if there already is a bug report on it, you certainly don't need to add another.

Last edited by Trilby (2012-10-10 11:38:16)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#6 2012-10-10 11:38:26

gravitezero
Member
Registered: 2012-05-03
Posts: 11

Re: [SOLVED] How to properly install optionnal dependencies ?

I didn't saw Awebb post, when I replied.
I will follow the links you gave me, to see the bug report.

About tl;dr. I understand your point. But I wrote it to help people who will read the post to very quickly determine if they could have an answer or not.
So, if they do, I think they should read the entire post to know the entire context, or more generally.
But yes, for a 4 lines post, I agree this seems a bit awkward and maybe insulting, and the topic title is designed for the exact same purpose.

Offline

#7 2012-10-10 11:45:20

gravitezero
Member
Registered: 2012-05-03
Posts: 11

Re: [SOLVED] How to properly install optionnal dependencies ?

@Awebb
   It seems that you didn't understood my problem, because both the topic and the bug report are really not related to my topic.

@Trillby
  I do agree with you, I meant feature request, but as it's reported on a bug tracker ... well ... smile

Edit:
The topic Awebb pointed to contains in fact, in the last post a link to : https://wiki.archlinux.org/index.php/Us … OptDepends
A page where Allan describe some of the behavior he implemented about OptDepends, some of these seems relevant to my problem and will maybe be released with pacman 4.1.

Last edited by gravitezero (2012-10-10 12:03:23)

Offline

#8 2012-10-10 12:03:33

Allan
Developer
From: Brisbane, AU
Registered: 2007-06-09
Posts: 10,367
Website

Re: [SOLVED] How to properly install optionnal dependencies ?

pacman will have some improvements in this regard (probably in 4.1), but these will all be informational in nature. E.g.

> pacman -R tk
checking dependencies...
:: git optionally requires tk: gitk and git gui
:: python optionally requires tk: for tkinter
:: python2 optionally requires tk: for IDLE
:: r optionally requires tk: tcl/tk interface

Packages (1): tk-8.5.12-1
> pacman -S python
...
(1/1) installing python                            [######################] 100%
Optional dependencies for python
    tk: for tkinter [installed]
    sqlite [installed]
> pacman -Qi tk
Name           : tk
Version        : 8.5.12-1
...
Required By    : None
Optional For   : git  python  python2  r

The further improvements on the wiki page will likely wait until 4.2.

Offline

Board footer

Powered by FluxBB