[pacman-dev] Option Depency Ideas
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. * 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?" 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.) 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. 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% * 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. * 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. 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. // jeff -- .: [ + carpe diem totus tuus + ] :.
2007/11/3, Jeff 'codemac' Mickey <jeff@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 (Роман Кирилич)
On Nov 2, 2007 4:02 PM, Jeff 'codemac' Mickey <jeff@archlinux.org> wrote:
The next steps appear to be the following:
* makepkg should recognize the 'pkg:reason for package being option' format I've seen thrown around.
What do you mean by "recognize" here? I'm thinking that on install we should ensure that in addition to the depends and makedepends being installed, we also have all of the optdepends installed. This would ensure anyone using the package can use all the features the optdepends packages would provide. Of course, this should be skippable the same way other depends checks can be skipped (with the -d flag). The only caveat is that you have to parse the package name out of the array first (quite easy with bash once you figure out the syntax however).
* 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?" Tricky with our current events system. Talk to (pester?) Aaron about fixing this. :)
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.)
At least as a first step, just printing them in some format might not be a bad idea. You could probably even omit the printing of those entries that are already installed anyway.
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.
-1, not kiss.
o Something else I haven't thought of.
You didn't take into account the case where an optdepend was already installed and we want to use it, or even the more obscure case where it is installed but we DON'T want to use it.
* 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%
I don't think having depends/requiredby entries out of sync is a good idea, given the primitive nature of our DB. See last comment above as well.
* 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. Hmm. This will need more thought. I guess I want to keep OPTDEPENDS as unobtrusive as possible, and this starts to break that.
* 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.
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.
I don't know if I gave you enough to work with there, so let me know. -Dan
* 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?" Note: too many questions with the current front-end. [So if foo is installed, that should be automatically updated by default.] 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.) I think, install reason should be optdepend. But the current %REASON% handling is still buggy...: http://www.archlinux.org/pipermail/pacman-dev/2007-September/009271.html 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. Only GUI front-end helps here IMHO (the same for groups)
* 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% NO. This would break %DEPENDS% -- %REQUIREDBY% relationship. I suggest %OPTREQUIREDBY% for %OPTDEPENDS%. * 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% See above.
Bye, ngaba ---------------------------------------------------- SZTE Egyetemi Könyvtár - http://www.bibl.u-szeged.hu This mail sent through IMP: http://horde.org/imp/
participants (4)
-
Dan McGee
-
Jeff 'codemac' Mickey
-
Nagy Gabor
-
Roman Kyrylych