Okay, here's a summary of what we've decided on IRC so far:
1. No more wrapper. No more user-level selection. It's all symlinks.
2. The description files are now formatted like this:
# to make the /usr/bin/perl symlink for perl-5.8.8
TARGET_perl=/usr/bin/perl5.8.8
PATH_perl=/usr/bin/perl
There are two classes of variables, TARGET_* and PATH_*. The * part is
arbitrary -- it only exists to provide a mapping between TARGET and
PATH.
3. We want to let people do something like:
eselect perl 5.8
rather than:
eselect alternatives perl 5.8
To do this, the current idea is that we will instead make the
alternatives eselect module into an eselect library. Then, we will have
a category exlib that will build tiny stub eselect modules that use the
alternatives library.
So, we have:
packages/sys-eselect/anternatives-modules.exlib
packages/sys-eselect/vi/vi-0.exheres-0
The exlib builds and installs an eselect module like this:
require alternatives
DESCRIPTION="${ALTERNATIVES_DESCRIPTION}" # set in
sys-eselect/vi/vi-0.exheres-0
Then, packages that provide alternatives, like in this case vim, would
install:
/etc/alternatives/vi/vim:
TARGET_vi=/usr/bin/vim
PATH_vi=/usr/bin/vi
TARGET_ex=/usr/bin/vim
PATH_ex=/usr/bin/ex
...
The vim exheres (well, exlib), would require the repo-wide
alternatives.exlib. That exlib would be in charge of building and
installing those alternatives files. That would be done with the
function called alternatives_for, called in src_install.
It take this form:
alternatives_for alternative provider [unique source target ...]
Where alternative is the name of the alternative being provided ("vi"),
provider is the name of the thing providing that alternative ("vim"),
unique is the unique foo that lets us map TARGET and PATH together (so,
"vi" and "ex" in the above example).
You can specify multiple tuples of unique, source, and target. Or, you
can just call alternatives_for on the same module name multiple times.
Either way, it will just add the appropriate TARGET_* and PATH_* lines
to ${IMAGE}/etc/alternatives/${alternative}/${provider}
Okay, I think that's everything I can remember so far. Please tell me
what I've forgotten...
--
Mike Kelly
_______________________________________________
Exherbo-dev mailing list
[email protected]
http://lists.exherbo.org/mailman/listinfo/exherbo-dev