Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/
Date: Thu, 28 Jan 2016 14:49:08
Message-Id: 1453992337.ef0386227889557b516d86fd395417b20aa5c4a1.mjo@gentoo
1 commit: ef0386227889557b516d86fd395417b20aa5c4a1
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 28 01:30:26 2016 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 28 14:45:37 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef038622
7
8 dev-lang/php: call `eselect php cleanup` in pkg_postinst and pkg_postrm.
9
10 We have two bugs (432962 and 572436) regarding stale eselect symlinks.
11
12 The first issue is that removal of an old slot does not update the
13 eselect-php symlinks to point to a newer slot. Thus, if a user
14 upgrades slots and depcleans the old one, his symlinks (and thus PHP)
15 are left broken until eselect-php is run manually. This is fixed by
16 running `eselect php cleanup` in pkg_postrm, since removal of the
17 old slot will trigger a cleanup (which updates the symlink).
18
19 The second issue is that disabling a SAPI would leave behind a broken
20 symlink. For example, if the "cgi" SAPI was once used but the user has
21 reinstalled PHP with USE="-cgi", then the old eselect-php symlink for
22 php-cgi would be left behind. This is fixed by running `eselect php
23 cleanup` in pkg_postinst, since that will be triggered after the
24 reinstall finishes, at which point the php-cgi symlink will be dead
25 and thus get removed.
26
27 Gentoo-Bug: 432962
28 Gentoo-Bug: 572436
29
30 Package-Manager: portage-2.2.26
31
32 .../{php-5.6.17-r3.ebuild => php-5.6.17-r4.ebuild} | 21 ++++++++++++++++++---
33 .../{php-7.0.2-r3.ebuild => php-7.0.2-r4.ebuild} | 21 ++++++++++++++++++---
34 2 files changed, 36 insertions(+), 6 deletions(-)
35
36 diff --git a/dev-lang/php/php-5.6.17-r3.ebuild b/dev-lang/php/php-5.6.17-r4.ebuild
37 similarity index 96%
38 rename from dev-lang/php/php-5.6.17-r3.ebuild
39 rename to dev-lang/php/php-5.6.17-r4.ebuild
40 index 7d9db68..4180cd6 100644
41 --- a/dev-lang/php/php-5.6.17-r3.ebuild
42 +++ b/dev-lang/php/php-5.6.17-r4.ebuild
43 @@ -76,7 +76,7 @@ IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
44 +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
45
46 DEPEND="
47 - >=app-eselect/eselect-php-0.7.1-r3[apache2?,fpm?]
48 + >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
49 >=dev-libs/libpcre-8.32[unicode]
50 apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
51 <www-servers/apache-2.4[threads=] ) )"
52 @@ -764,6 +764,13 @@ pkg_postinst() {
53 fi
54 done
55
56 + # Remove dead symlinks for SAPIs that were just disabled. For
57 + # example, if the user has the cgi SAPI enabled, then he has an
58 + # eselect-php symlink for it. If he later reinstalls PHP with
59 + # USE="-cgi", that symlink will break. This call to eselect is
60 + # supposed to remove that dead link per bug 572436.
61 + eselect php cleanup || die
62 +
63 elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes"
64 elog "php${SLOT/./-} in order to compile extensions for the ${SLOT} ABI."
65 elog
66 @@ -786,7 +793,15 @@ pkg_postinst() {
67 elog
68 }
69
70 -pkg_prerm() {
71 - # This returns "1" on success so we can't "|| die" here.
72 +pkg_postrm() {
73 + # This serves two purposes. First, if we have just removed the last
74 + # installed version of PHP, then this will remove any dead symlinks
75 + # belonging to eselect-php. Second, if a user upgrades slots from
76 + # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
77 + # his existing symlinks to point to the new 7.0 installation. The
78 + # latter is bug 432962.
79 + #
80 + # Note: the eselect-php package may not be installed at this point,
81 + # so we can't die() if this command fails.
82 eselect php cleanup
83 }
84
85 diff --git a/dev-lang/php/php-7.0.2-r3.ebuild b/dev-lang/php/php-7.0.2-r4.ebuild
86 similarity index 96%
87 rename from dev-lang/php/php-7.0.2-r3.ebuild
88 rename to dev-lang/php/php-7.0.2-r4.ebuild
89 index 8d8f27c..e30254f 100644
90 --- a/dev-lang/php/php-7.0.2-r3.ebuild
91 +++ b/dev-lang/php/php-7.0.2-r4.ebuild
92 @@ -76,7 +76,7 @@ IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
93 +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
94
95 DEPEND="
96 - >=app-eselect/eselect-php-0.8.2[apache2?,fpm?]
97 + >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
98 >=dev-libs/libpcre-8.32[unicode]
99 apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
100 <www-servers/apache-2.4[threads=] ) )"
101 @@ -756,6 +756,13 @@ pkg_postinst() {
102 fi
103 done
104
105 + # Remove dead symlinks for SAPIs that were just disabled. For
106 + # example, if the user has the cgi SAPI enabled, then he has an
107 + # eselect-php symlink for it. If he later reinstalls PHP with
108 + # USE="-cgi", that symlink will break. This call to eselect is
109 + # supposed to remove that dead link per bug 572436.
110 + eselect php cleanup || die
111 +
112 elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes"
113 elog "php${SLOT/./-} in order to compile extensions for the ${SLOT} ABI."
114 elog
115 @@ -778,7 +785,15 @@ pkg_postinst() {
116 elog
117 }
118
119 -pkg_prerm() {
120 - # This returns "1" on success so we can't "|| die" here.
121 +pkg_postrm() {
122 + # This serves two purposes. First, if we have just removed the last
123 + # installed version of PHP, then this will remove any dead symlinks
124 + # belonging to eselect-php. Second, if a user upgrades slots from
125 + # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
126 + # his existing symlinks to point to the new 7.0 installation. The
127 + # latter is bug 432962.
128 + #
129 + # Note: the eselect-php package may not be installed at this point,
130 + # so we can't die() if this command fails.
131 eselect php cleanup
132 }