Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/eselect-php:master commit in: src/
Date: Sat, 29 Feb 2020 22:16:23
Message-Id: 1582936289.3c19c8620a6e7aef01496d0d0f72162f1964f3d9.mjo@gentoo
1 commit: 3c19c8620a6e7aef01496d0d0f72162f1964f3d9
2 Author: Stefan Langenmaier <stefan.langenmaier <AT> gmail <DOT> com>
3 AuthorDate: Wed Feb 12 16:24:53 2020 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 29 00:31:29 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/eselect-php.git/commit/?id=3c19c862
7
8 respect ROOT env variable
9
10 Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
11
12 src/php.eselect.in.in | 26 ++++++++++++++++++--------
13 1 file changed, 18 insertions(+), 8 deletions(-)
14
15 diff --git a/src/php.eselect.in.in b/src/php.eselect.in.in
16 index 290d2ff..a047c62 100644
17 --- a/src/php.eselect.in.in
18 +++ b/src/php.eselect.in.in
19 @@ -113,11 +113,11 @@ sapi_active_link_dir() {
20 local sapi="${1}"
21
22 case "${sapi}" in
23 - apache2) echo "@LIBDIR@/apache2/modules" ;;
24 - cli) echo "@BINDIR@" ;;
25 - fpm) echo "@BINDIR@" ;;
26 - cgi) echo "@BINDIR@" ;;
27 - phpdbg) echo "@BINDIR@" ;;
28 + apache2) echo "${ROOT%/}@LIBDIR@/apache2/modules" ;;
29 + cli) echo "${ROOT%/}@BINDIR@" ;;
30 + fpm) echo "${ROOT%/}@BINDIR@" ;;
31 + cgi) echo "${ROOT%/}@BINDIR@" ;;
32 + phpdbg) echo "${ROOT%/}@BINDIR@" ;;
33 *) die "invalid SAPI name: ${sapi}" ;;
34 esac
35 }
36 @@ -249,7 +249,7 @@ find_targets() {
37 # TODO: when there aren't any phpX.Y directories, this returns
38 # "php*.*". This doesn't seem to bother our consumers, but it
39 # would probably be more polite to return nothing in that case.
40 - cd "@LIBDIR@" && echo php*.*
41 + cd "${ROOT%/}@LIBDIR@" && echo php*.*
42 }
43
44 # List all valid targets for the given SAPI. The list is obtained by
45 @@ -283,7 +283,7 @@ find_sapi_targets() {
46 esac
47
48 for target in $(find_targets); do
49 - local pattern="@LIBDIR@/${target}/${pattern_suffix}"
50 + local pattern="${ROOT%/}@LIBDIR@/${target}/${pattern_suffix}"
51
52 for file in $pattern; do
53 [[ -f "${file}" ]] && echo "${target}"
54 @@ -338,7 +338,7 @@ get_sapi_active_target() {
55 #
56 write_mod_php_conf() {
57 local target="${1}"
58 - local conf_dir="@LOCALSTATEDIR@/lib/eselect-php"
59 + local conf_dir="${ROOT%/}@LOCALSTATEDIR@/lib/eselect-php"
60 local conf_path="${conf_dir}/mod_php.conf"
61
62 @MKDIR_P@ "${conf_dir}" || die "failed to create ${conf_dir}"
63 @@ -516,6 +516,11 @@ describe_list_options() {
64 }
65
66 do_list() {
67 + if [ "${ROOT%/}" != "" ] ; then
68 + local msg
69 + write_warning_msg "ROOT only supported in setting the configuration"
70 + echo
71 + fi
72 local sapi="${1}"
73 check_module "${sapi}"
74 list_sapi "${sapi}"
75 @@ -536,6 +541,11 @@ describe_show_options() {
76 }
77
78 do_show() {
79 + if [ "${ROOT%/}" != "" ] ; then
80 + local msg
81 + write_warning_msg "ROOT only supported in setting the configuration"
82 + echo
83 + fi
84 local sapi="${1}"
85 check_module "${sapi}"
86 get_sapi_active_target "${sapi}"