From: Ian Stakenvicius Date: Mon, 13 Mar 2017 15:35:58 +0000 (-0400) Subject: mail-client/thunderbird: fix enigmail symlink installation X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=99b163f52f313d45f9323717a4071586097ffc58;p=gentoo.git mail-client/thunderbird: fix enigmail symlink installation Limitations in package managers prevent a symbolic link from replacing a directory at merge time. This patch addresses that issue by removing the directory belonging to the currently installed thunderbird in pkg_preinst(). It's been tested against a direct upgrade form 45.7.0 as well as a reinstall, and seems to do the 'right thing' in all cases. Package-Manager: portage-2.3.3 --- diff --git a/mail-client/thunderbird/thunderbird-45.8.0.ebuild b/mail-client/thunderbird/thunderbird-45.8.0.ebuild index c1cb3c2275f4..c167e54982c3 100644 --- a/mail-client/thunderbird/thunderbird-45.8.0.ebuild +++ b/mail-client/thunderbird/thunderbird-45.8.0.ebuild @@ -302,9 +302,9 @@ src_install() { fi if use crypt ; then - emid=$(sed -n '//!d; s/.*\({.*}\).*/\1/; p; q' /usr/share/enigmail/install.rdf) + emid=$(sed -n '//!d; s/.*\({.*}\).*/\1/; p; q' "${EPREFIX}"/usr/share/enigmail/install.rdf) if [[ -n ${emid} ]]; then - dosym /usr/share/enigmail ${MOZILLA_FIVE_HOME}/extensions/${emid} + dosym "${EPREFIX}"/usr/share/enigmail ${MOZILLA_FIVE_HOME}/extensions/${emid} else die " tag for installed enigmail could not be found!" fi @@ -325,6 +325,20 @@ src_install() { pkg_preinst() { gnome2_icon_savelist + + # Because PM's dont seem to properly merge a symlink replacing a directory + if use crypt ; then + local emid=$(sed -n '//!d; s/.*\({.*}\).*/\1/; p; q' "${EPREFIX}"/usr/share/enigmail/install.rdf) + if [[ -d "${EPREFIX}${MOZILLA_FIVE_HOME}/extensions/${emid}" ]] ; then + rm -Rf "${EPREFIX}${MOZILLA_FIVE_HOME}/extensions/${emid}" || ( + eerror "Could not remove enigmail directory from previous installation," + eerror "You must remove this by hand and rename the symbolic link yourself:" + eerror + eerror "\t cd ${EPREFIX}${MOZILLA_FIVE_HOME}/extensions" + eerror "\t rm -Rf ${emid}" + eerror "\t mv ${emid}.backup* ${emid}" ) + fi + fi } pkg_postinst() {