[pacman-dev] Option Depency Ideas
Roman Kyrylych
roman.kyrylych at gmail.com
Sat Nov 3 08:24:07 EDT 2007
2007/11/3, Jeff 'codemac' Mickey <jeff at archlinux.org>:
> Hello all.
>
> I figure I should start flexing my "zomg coding" muscles a little more for
> the benefit of arch. What interests me the most right now is optional
> dependencies. In my local git tree I have added pactest support for
> testing option dependencies, but I only have one joke of a pactest that
> checks.
>
> Thanks to Dan, a lot of the work that I really would have a harder time
> getting right has all ready been done, in adding the right lines to
> makepkg, libalpm, and pacman so that the optional dependencies are recorded
> in the db. Right now they are only recognized as simple strings, not as
> packages with dependency resolution or any of that fun stuff (correct me if
> I'm wrong here Dan).
>
> The next steps appear to be the following:
>
> * makepkg should recognize the 'pkg:reason for package being option' format
> I've seen thrown around.
Yes.
>
> * When a package is installed with optional dependencies, we can do a
> couple different things.
> o Ask the user right there with the "Install package foo for xyz
> support?"
Yes.
> o Ask the user to explicitly install the optional deps themselves (I
> don't think this is good at all. This wouldn't keep them listed as
> "installed as a dependency" and we could just have echo statements in
> the .install then.)
Could be useful with --noconfirm.
> o Check for some kind of /etc/pacman.conf var that lists what packages
> users don't mind having as optional dependencies, otherwise ask them
> to install them.
Nah, that will turn into Gentoo's USE flags.
> o Something else I haven't thought of.
>
> * When an optional dependency is installed through one of the 3 ways listed
> above, we need to install it as a dependency, and add it to %DEPENDS%,
> leave it in %OPTDEPENDS%, and not put it in %REQUIREDBY%
Leave it in %OPTDEPENDS% and do not put it in %REQUIREDBY% and %DEPENDS%.
>
> * When an optional dependency is uninstalled that was only ever installed
> as a dependency, we can do several things.
> o We warn the user that they are losing functionality, and remove it
> from the %DEPENDS% array in the parent.
> o We let pacman handle it like it does dependcies, this is what we get
> when we add the optional dependency to just %DEPENDS% and not
> %REQUIREDBY%
> o Something else I haven't thought of.
IMO Pacman should handle optdepends not in the same way as depends,
so it should be removed from %OPTDEPENDS% array of there parent.
About %REQUIREDBY% - probably there should be %OPTREQUIREDBY% ?
>
> * When a package with optional dependencies is removed, it should also
> remove all other packages that have been moved into %DEPENDS% haven't
> been explicitly installed. I believe this is funcitonality that we get
> by adding it to the %DEPENDS% array anyways.
Then any optdepends that doesn't have other packages in %REQUIREDBY%
and %OPTREQUIREDBY% should be asked for removal.
>
> I just wanted to get these thoughts out there. I thought I was just going
> to implement basic -Qi functionality and then address these.. but Dan is a
> beast and jumped the gun on me.
>
> I would like to hear all of your thoughts on the above ideas, and let's
> flesh out what action we'd like to see pacman take based on these
> difference scenarios.
>
References:
http://bugs.archlinux.org/task/4845#comment10357
http://archlinux.org/pipermail/pacman-dev/2006-October/005999.html
http://archlinux.org/pipermail/pacman-dev/2007-September/009426.html
--
Roman Kyrylych (Роман Кирилич)
More information about the pacman-dev
mailing list