summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Orlitzky <mjo@gentoo.org>2016-01-27 20:30:26 -0500
committerMichael Orlitzky <mjo@gentoo.org>2016-01-28 09:45:37 -0500
commitef0386227889557b516d86fd395417b20aa5c4a1 (patch)
tree15d19cc4a104830cf65d0fb008068359b19a5219 /dev-lang/php
parentdev-lang/php: revision the 5.6 and 7.0 series to add sys-libs/db:5.3 support. (diff)
downloadgentoo-ef0386227889557b516d86fd395417b20aa5c4a1.tar.gz
gentoo-ef0386227889557b516d86fd395417b20aa5c4a1.tar.bz2
gentoo-ef0386227889557b516d86fd395417b20aa5c4a1.zip
dev-lang/php: call `eselect php cleanup` in pkg_postinst and pkg_postrm.
We have two bugs (432962 and 572436) regarding stale eselect symlinks. The first issue is that removal of an old slot does not update the eselect-php symlinks to point to a newer slot. Thus, if a user upgrades slots and depcleans the old one, his symlinks (and thus PHP) are left broken until eselect-php is run manually. This is fixed by running `eselect php cleanup` in pkg_postrm, since removal of the old slot will trigger a cleanup (which updates the symlink). The second issue is that disabling a SAPI would leave behind a broken symlink. For example, if the "cgi" SAPI was once used but the user has reinstalled PHP with USE="-cgi", then the old eselect-php symlink for php-cgi would be left behind. This is fixed by running `eselect php cleanup` in pkg_postinst, since that will be triggered after the reinstall finishes, at which point the php-cgi symlink will be dead and thus get removed. Gentoo-Bug: 432962 Gentoo-Bug: 572436 Package-Manager: portage-2.2.26
Diffstat (limited to 'dev-lang/php')
-rw-r--r--dev-lang/php/php-5.6.17-r4.ebuild (renamed from dev-lang/php/php-5.6.17-r3.ebuild)21
-rw-r--r--dev-lang/php/php-7.0.2-r4.ebuild (renamed from dev-lang/php/php-7.0.2-r3.ebuild)21
2 files changed, 36 insertions, 6 deletions
diff --git a/dev-lang/php/php-5.6.17-r3.ebuild b/dev-lang/php/php-5.6.17-r4.ebuild
index 7d9db68573e1..4180cd623ef3 100644
--- a/dev-lang/php/php-5.6.17-r3.ebuild
+++ b/dev-lang/php/php-5.6.17-r4.ebuild
@@ -76,7 +76,7 @@ IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
DEPEND="
- >=app-eselect/eselect-php-0.7.1-r3[apache2?,fpm?]
+ >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
>=dev-libs/libpcre-8.32[unicode]
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
<www-servers/apache-2.4[threads=] ) )"
@@ -764,6 +764,13 @@ pkg_postinst() {
fi
done
+ # Remove dead symlinks for SAPIs that were just disabled. For
+ # example, if the user has the cgi SAPI enabled, then he has an
+ # eselect-php symlink for it. If he later reinstalls PHP with
+ # USE="-cgi", that symlink will break. This call to eselect is
+ # supposed to remove that dead link per bug 572436.
+ eselect php cleanup || die
+
elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes"
elog "php${SLOT/./-} in order to compile extensions for the ${SLOT} ABI."
elog
@@ -786,7 +793,15 @@ pkg_postinst() {
elog
}
-pkg_prerm() {
- # This returns "1" on success so we can't "|| die" here.
+pkg_postrm() {
+ # This serves two purposes. First, if we have just removed the last
+ # installed version of PHP, then this will remove any dead symlinks
+ # belonging to eselect-php. Second, if a user upgrades slots from
+ # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
+ # his existing symlinks to point to the new 7.0 installation. The
+ # latter is bug 432962.
+ #
+ # Note: the eselect-php package may not be installed at this point,
+ # so we can't die() if this command fails.
eselect php cleanup
}
diff --git a/dev-lang/php/php-7.0.2-r3.ebuild b/dev-lang/php/php-7.0.2-r4.ebuild
index 8d8f27cbf89a..e30254fd950b 100644
--- a/dev-lang/php/php-7.0.2-r3.ebuild
+++ b/dev-lang/php/php-7.0.2-r4.ebuild
@@ -76,7 +76,7 @@ IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
DEPEND="
- >=app-eselect/eselect-php-0.8.2[apache2?,fpm?]
+ >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
>=dev-libs/libpcre-8.32[unicode]
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
<www-servers/apache-2.4[threads=] ) )"
@@ -756,6 +756,13 @@ pkg_postinst() {
fi
done
+ # Remove dead symlinks for SAPIs that were just disabled. For
+ # example, if the user has the cgi SAPI enabled, then he has an
+ # eselect-php symlink for it. If he later reinstalls PHP with
+ # USE="-cgi", that symlink will break. This call to eselect is
+ # supposed to remove that dead link per bug 572436.
+ eselect php cleanup || die
+
elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes"
elog "php${SLOT/./-} in order to compile extensions for the ${SLOT} ABI."
elog
@@ -778,7 +785,15 @@ pkg_postinst() {
elog
}
-pkg_prerm() {
- # This returns "1" on success so we can't "|| die" here.
+pkg_postrm() {
+ # This serves two purposes. First, if we have just removed the last
+ # installed version of PHP, then this will remove any dead symlinks
+ # belonging to eselect-php. Second, if a user upgrades slots from
+ # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
+ # his existing symlinks to point to the new 7.0 installation. The
+ # latter is bug 432962.
+ #
+ # Note: the eselect-php package may not be installed at this point,
+ # so we can't die() if this command fails.
eselect php cleanup
}