Gentoo Archives: gentoo-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Unnecessary logs: has_version to the rescue?
Date: Wed, 31 Mar 2010 20:29:31
Message-Id: 4BB3B11A.1020505@gentoo.org
In Reply to: Re: [gentoo-dev] Unnecessary logs: has_version to the rescue? by Ciaran McCreesh
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 On 03/31/2010 01:19 PM, Ciaran McCreesh wrote:
5 > On Wed, 31 Mar 2010 22:08:40 +0200
6 > Sebastian Pipping <sping@g.o> wrote:
7 >> Is there some kind of evilness in this usage of has_version that I am
8 >> not aware of?
9 >
10 > Unfortunately, yes.
11 >
12 > Historically, has_version in pkg_postinst would return results based
13 > upon the version that *was* installed. This feature was widely used to
14 > display context-aware post-install messages, and there were examples of
15 > it in the documentation. Portage then silently changed this behaviour,
16 > without an EAPI bump and without changing the documentation, breaking
17 > all those packages in the process. The resulting mess discouraged many
18 > people from bothering with that kind of thing...
19
20 For those who may not know, has_version can be called in pkg_preinst
21 to find the previous version, and the result can be stored in a
22 variable for us in pkg_postinst.
23
24 We also have plans for a REPLACING_VERSIONS variable which would be
25 useful in similar cases:
26
27 http://bugs.gentoo.org/show_bug.cgi?id=273646
28 - --
29 Thanks,
30 Zac
31 -----BEGIN PGP SIGNATURE-----
32 Version: GnuPG v2.0.14 (GNU/Linux)
33
34 iEYEARECAAYFAkuzsRcACgkQ/ejvha5XGaOnYQCg1+X8SnVBKqG1E+BdzjAm49lH
35 JYcAn3SG6fS+PJczSOMFxp1JeO6X38gK
36 =9MVB
37 -----END PGP SIGNATURE-----

Replies

Subject Author
Re: [gentoo-dev] Unnecessary logs: has_version to the rescue? Sebastian Pipping <sping@g.o>