1 |
On Thu, 4 Nov 2004 18:02:41 +0100 Thomas de Grenier de Latour |
2 |
<degrenier@×××××××××××.fr> wrote: |
3 |
| 1) Write an eclass that deals with that issue in a generic way. |
4 |
| Lets call it alternatives-symlink.eclass. What are the different |
5 |
| alternatives is declared by the ebuild using an env var, for |
6 |
| instance: |
7 |
| ALTERNATIVES="/usr/bin/vi:vim /usr/bin/view:vim /usr/bin/ex:vim" |
8 |
| (you can also use absolute path in second hand of each |
9 |
| declaration if needed.) |
10 |
|
11 |
Ok, yup, at first glance I'm liking this. Dunno if it'll survive |
12 |
scrutiny, but... If it turns out that it's worth creating a generic |
13 |
solution to this, what should it do? Here's some rough ideas of what it |
14 |
would need to handle... |
15 |
|
16 |
* Multiple versions of the same package, the way the current |
17 |
alternatives eclass handles things. For example, I might have foo-2.2 |
18 |
and foo-2.3 installed, and I'd need a link (not user switchable) from |
19 |
foo to foo-2.3. This link must be handled even when packages are |
20 |
unmerged, upgraded and so on. |
21 |
|
22 |
* Multiple versions of the same package with a sysadmin switchable |
23 |
symlink between versions. Basically a generic equivalent of gcc-config. |
24 |
|
25 |
* Multiple packages wanting the same convenience symlink. For example, |
26 |
vim, nvi, elvis and vi all want to provide 'vi', 'ex' and so on. This |
27 |
should be sysadmin-switchable, but if the currently selected provider is |
28 |
unmerged then a new default should be picked. At no point should we end |
29 |
up with duff symlinks. |
30 |
|
31 |
Regarding the last point -- personally I reckon it would be better if we |
32 |
could switch multiple packages at once through this. Like, for example, |
33 |
a 'vi' target would set the symlinks for vi, view and ex, and a gcc |
34 |
target would set the whole toolchain thing. |
35 |
|
36 |
Something like: |
37 |
|
38 |
# eselect --set vi vim |
39 |
# eselect --set kernel linux-2.6.7 |
40 |
# eselect --set gcc sparc-unknown-linux-gnu-3.3.4 |
41 |
|
42 |
and: |
43 |
|
44 |
# eselect --list kernel |
45 |
linux-2.6.7 (*) |
46 |
linux-2.6.8.1 |
47 |
linux-2.6.10_rc1 |
48 |
|
49 |
and: |
50 |
|
51 |
# eselect --list |
52 |
gcc sparc-unknown-linux-gnu-3.3.4 |
53 |
kernel: linux-2.6.7 |
54 |
vi: /usr/bin/vim |
55 |
|
56 |
could be rather cool. So... I guess the question really is, is it worth |
57 |
making all this generic and flexible, or is it simpler to just keep the |
58 |
current collection of blah-config tools and make more as needed? Can we |
59 |
nick any ideas from the Debian system? Will this idea still look good |
60 |
when I haven't had large numbers of girly foofoo drinks? |
61 |
|
62 |
-- |
63 |
Ciaran McCreesh : Gentoo Developer (Vim, Fluxbox, Sparc, Mips) |
64 |
Mail : ciaranm at gentoo.org |
65 |
Web : http://dev.gentoo.org/~ciaranm |