Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/eselect-php:master commit in: src/
Date: Fri, 18 Dec 2015 02:28:05
Message-Id: 1450405648.270d0436bdffcf82d8981b28a9833569146332d0.grknight@gentoo
1 commit: 270d0436bdffcf82d8981b28a9833569146332d0
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 18 02:27:28 2015 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 18 02:27:28 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/eselect-php.git/commit/?id=270d0436
7
8 Add support for the phpdbg SAPI target
9
10 Signed-off-by: Brian Evans <grknight <AT> gentoo.org>
11
12 src/php.eselect.in | 40 +++++++++++++++++++++++++++++++++++++++-
13 1 file changed, 39 insertions(+), 1 deletion(-)
14
15 diff --git a/src/php.eselect.in b/src/php.eselect.in
16 index 7e918ab..10edcbd 100644
17 --- a/src/php.eselect.in
18 +++ b/src/php.eselect.in
19 @@ -6,11 +6,12 @@ inherit config multilib
20 DESCRIPTION="Manage php installations"
21 MAINTAINER="php-bugs@g.o"
22
23 -MODULES="cli apache2 fpm cgi"
24 +MODULES="cli apache2 fpm cgi phpdbg"
25
26 cli_link="${EROOT}"/usr/bin/php
27 fpm_link="${EROOT}"/usr/bin/php-fpm
28 cgi_link="${EROOT}"/usr/bin/php-cgi
29 +dbg_link="${EROOT}"/usr/bin/phpdbg
30
31 cleanup_sapis() {
32 local m
33 @@ -137,6 +138,15 @@ find_targets_cgi() {
34 done | @SORT@ | @UNIQ@
35 }
36
37 +find_targets_phpdbg() {
38 + local target libdir
39 + for target in $(find_targets); do
40 + for libdir in $(get_libdirs); do
41 + [[ -f ${EROOT}${libdir}/$target/bin/phpdbg ]] && echo $target
42 + done
43 + done | @SORT@ | @UNIQ@
44 +}
45 +
46 get_active_cli() {
47 # See get_active_apache2() for an explanation of the sed call.
48 local target=$(canonicalise "${cli_link}")
49 @@ -158,6 +168,13 @@ get_active_fpm() {
50 [[ -a "${target}" ]] && echo "${target}" | @SED@ -ne "${ver}"
51 }
52
53 +get_active_phpdbg() {
54 + # See get_active_apache2() for an explanation of the sed call.
55 + local target=$(canonicalise "${dbg_link}")
56 + local ver="s:.*/usr/.*/\(php[0-9]\.[0-9][0-9]*\)/bin/phpdbg:\1:p"
57 + [[ -a "${target}" ]] && echo "${target}" | @SED@ -ne "${ver}"
58 +}
59 +
60 # The path to the active version of the apache2 module, which should
61 # be a symlink. This is the path used by our apache configuration to
62 # load the PHP module. The path is unversioned (that is, it has no "5"
63 @@ -309,6 +326,19 @@ list_fpm() {
64 write_numbered_list -m "(none found)" "${targets[@]}"
65 }
66
67 +list_phpdbg() {
68 + local targets
69 + local a
70 + targets=( $(find_targets_phpdbg) )
71 + a=$(get_active_phpdbg)
72 + for (( i = 0; i < ${#targets[@]}; i++ )) ; do
73 + if [[ $a == ${targets[i]} ]] ; then
74 + targets[i]=$(highlight_marker "${targets[i]}")
75 + fi
76 + done
77 + write_numbered_list -m "(none found)" "${targets[@]}"
78 +}
79 +
80 set_apache2() {
81 local active_symlink libdir target=$(resolv_target apache2 $1)
82 active_symlink="$(get_apache2_active_symlink_path)"
83 @@ -345,6 +375,14 @@ set_cgi() {
84 die -q "failed to create active php-cgi symlink"
85 }
86
87 +set_phpdbg() {
88 + t=$(resolv_target phpdbg $1)
89 + [[ -z $t ]] && die -q "invalid target"
90 + @LN_S@ --force "../..$(get_active_libdir)/${t}/bin/phpdbg" \
91 + "${dbg_link}" || \
92 + die -q "failed to create active phpdbg symlink"
93 +}
94 +
95 set_fpm() {
96 local t=$(resolv_target fpm $1)
97 [[ -z $t ]] && die -q "invalid target"