Gentoo Archives: gentoo-dev

From: Thomas de Grenier de Latour <degrenier@×××××××××××.fr>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Handling multiple packages providing the same convenience symlink
Date: Thu, 04 Nov 2004 19:54:35
Message-Id: 20041104205423.3499f58a@eusebe
In Reply to: Re: [gentoo-dev] Handling multiple packages providing the same convenience symlink by Ciaran McCreesh
1 On Thu, 4 Nov 2004 18:21:43 +0000
2 Ciaran McCreesh <ciaranm@g.o> wrote:
3
4 > * Multiple versions of the same package, the way the current
5 > alternatives eclass handles things. For example, I might have
6 > foo-2.2 and foo-2.3 installed, and I'd need a link (not user
7 > switchable) from foo to foo-2.3. This link must be handled even
8 > when packages are unmerged, upgraded and so on.
9
10 I don't see how that could be integrated in what i had in mind
11 (which for sure doesn't mean it can't). It sounds to me as a
12 different problem, for which alternatives.eclass already does the
13 job, so i'm not big on changing that.
14
15 > * Multiple versions of the same package with a sysadmin
16 > switchable symlink between versions.
17
18 Different slotted versions is very similar to different packages
19 imho. For instance:
20 ALTERNATIVES="/usr/bin/gimp:gimp-${SLOT}"
21 would probably do the trick for switching beetween gimp-1.2 and
22 gimp-2.0. Or for kernel sources:
23 ALTERNATIVES="/usr/src/linux:linux-${KV}"
24
25 > * Multiple packages wanting the same convenience symlink.
26 <snip>
27 > personally I reckon it would be better if we could switch
28 > multiple packages at once through this.
29
30 We could add a group declaration in ebuilds. The complete
31 declaration for vim would then become:
32 ALTERNATIVES="/usr/bin/vi:vim /usr/bin/view:vim /usr/bin/ex:vim"
33 ALTERNATIVES_GROUP="vi:vim"
34 Groups would be recorded in a separate file, lets say
35 /var/lib/portage/alternatives_groups. After installing vim, that
36 file would contain:
37 vi:vim /usr/bin/vi:vim /usr/bin/view:vim /usr/bin/ex:vim
38 Sure groups may also be used for simply giving a name to a single
39 alternative, like for instance:
40 ALTERNATIVES="/usr/src/linux:linux-${KV}"
41 ALTERNATIVES_GROUP="kernel:${KV}"
42
43 What eselect would show would be only groups by default, but maybe
44 it could have an option to show individual alternatives from
45 /var/lib/portage/alternatives (for people who want vi to be the
46 real vi but view to be the vim version).
47
48
49 Oh, and something else that crossed my mind: should $ALTERNATIVES
50 be USE-expanded (i mean, allows some "blah?(foo:bar)" syntax)?
51 Just imagine the case of yet another vi-clone that only support
52 the"view" mode when compiled with a particular USE flag... ok,
53 that's not a realistic example. Anyway, if it should, that would
54 probably mean implementation at portage level instead of eclass
55 level :/
56
57 --
58 TGL.
59
60 --
61 gentoo-dev@g.o mailing list