1 |
commit: a4c6e0989d1233ba475b0b890d9d084b113682be |
2 |
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Feb 29 00:46:24 2020 +0000 |
4 |
Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Feb 29 22:00:00 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/eselect-php.git/commit/?id=a4c6e098 |
7 |
|
8 |
src/php.eselect.in.in: enable nullglob during find_targets(). |
9 |
|
10 |
While it didn't appear to hurt anything, the find_targets() function |
11 |
could output a literal "php*.*" when there were no valid PHP targets. |
12 |
Now the "nullglob" shell option is enabled during that function. |
13 |
|
14 |
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org> |
15 |
|
16 |
src/php.eselect.in.in | 8 +++++--- |
17 |
1 file changed, 5 insertions(+), 3 deletions(-) |
18 |
|
19 |
diff --git a/src/php.eselect.in.in b/src/php.eselect.in.in |
20 |
index a047c62..12ef1e1 100644 |
21 |
--- a/src/php.eselect.in.in |
22 |
+++ b/src/php.eselect.in.in |
23 |
@@ -246,10 +246,12 @@ update_sapi() { |
24 |
# A space-separated list of target names, for example, "php5.6 php7.0". |
25 |
# |
26 |
find_targets() { |
27 |
- # TODO: when there aren't any phpX.Y directories, this returns |
28 |
- # "php*.*". This doesn't seem to bother our consumers, but it |
29 |
- # would probably be more polite to return nothing in that case. |
30 |
+ # Temporarily enable the "nullglob" shell option to ensure that we |
31 |
+ # don't return a literal "php*.*" when there are no valid targets. |
32 |
+ local shopt_nullglob_saved=$(shopt -p nullglob) |
33 |
+ shopt -s nullglob |
34 |
cd "${ROOT%/}@LIBDIR@" && echo php*.* |
35 |
+ ${shopt_nullglob_saved} |
36 |
} |
37 |
|
38 |
# List all valid targets for the given SAPI. The list is obtained by |