-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 03/31/2010 01:19 PM, Ciaran McCreesh wrote: > On Wed, 31 Mar 2010 22:08:40 +0200 > Sebastian Pipping <sp...@gentoo.org> wrote: >> Is there some kind of evilness in this usage of has_version that I am >> not aware of? > > Unfortunately, yes. > > Historically, has_version in pkg_postinst would return results based > upon the version that *was* installed. This feature was widely used to > display context-aware post-install messages, and there were examples of > it in the documentation. Portage then silently changed this behaviour, > without an EAPI bump and without changing the documentation, breaking > all those packages in the process. The resulting mess discouraged many > people from bothering with that kind of thing...
For those who may not know, has_version can be called in pkg_preinst to find the previous version, and the result can be stored in a variable for us in pkg_postinst. We also have plans for a REPLACING_VERSIONS variable which would be useful in similar cases: http://bugs.gentoo.org/show_bug.cgi?id=273646 - -- Thanks, Zac -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) iEYEARECAAYFAkuzsRcACgkQ/ejvha5XGaOnYQCg1+X8SnVBKqG1E+BdzjAm49lH JYcAn3SG6fS+PJczSOMFxp1JeO6X38gK =9MVB -----END PGP SIGNATURE-----