Gentoo Archives: gentoo-dev

From: Alastair Tse <liquidx@g.o>
To: gentoo-dev@g.o
Subject: [gentoo-dev] alternatives.eclass
Date: Sat, 04 Oct 2003 18:10:14
Message-Id: 1065291006.9413.20.camel@huggins.eng.cam.ac.uk
1 Hi All,
2
3 I've written a helper function in an eclass form which maybe useful to
4 some of you who maintain SLOT'ed packages. I'm trying to solicit any
5 arguments for or against committing this to the tree.
6
7 Essentially, some slotted packages require a symlink to link to the
8 latest version of an executable or library. For instance, dev-util/guile
9 and dev-lang/python. However, because it is not guaranteed that a user
10 will merge a package in the natural version order, it is possible that a
11 symlink may not point to the latest version.
12
13 To illustrate this example further, consider this:
14
15 emerge =dev-lang/python-2.2.3
16 # this will create /usr/bin/python -> /usr/bin/python2.2
17 emerge =dev-lang/python-2.3.2
18 # this will create /usr/bin/python -> /usr/bin/python2.3
19 emerge =dev-lang/python-2.2.3-r1
20 # this will create /usr/bin/python -> /usr/bin/python2.2
21
22 Given that python is slotted (2.2 and 2.3), this means /usr/bin/python
23 no longer points to the latest version even though it should and the
24 user would expect it to.
25
26 Therefore, this simple script will iterate through a sorted list of
27 choices to symlink and choose the first one that exists. This would be
28 useful to putting into pkg_postinst() and pkg_postrm() to make sure the
29 symlinks are correct.
30
31 The details are in the eclass itself that can be found at:
32
33 http://dev.gentoo.org/~liquidx/files/alternatives.eclass
34
35 And an example of it's use can be found in:
36
37 http://dev.gentoo.org/~liquidx/files/python-2.2.3-r2.ebuild
38
39 Cheers,
40 --
41 Alastair 'liquidx' Tse
42 >> Gentoo Developer
43 >> http://www.liquidx.net/ | http://dev.gentoo.org/~liquidx/
44 >> GPG Key : http://dev.gentoo.org/~liquidx/liquidx_gentoo_org.asc
45 >> FingerPrint : 579A 9B0E 43E8 0E40 EE93 BB1C 38CE 1C7B 3907 14F6

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] alternatives.eclass Paul de Vrieze <pauldv@g.o>