Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Mon, 29 Jan 2018 13:48:18
Message-Id: 1517233632.2c3113fdedacb36b9b38482640ca6d14dd006438.grknight@gentoo
1 commit: 2c3113fdedacb36b9b38482640ca6d14dd006438
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 26 14:52:27 2018 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 29 13:47:12 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2c3113fd
7
8 php-ext-source-r3.eclass: Introduce PHP_INI_NAME variable
9
10 Currently php-ext-source-r3 saves the enabling ini file as
11 "${PHP_EXT_NAME}.ini". This is problematic when foo module needs to be
12 loaded before bar module as things are read in directory order.
13
14 This patch introduces PHP_INI_NAME which defaults to PHP_EXT_NAME for
15 backwards-compatibility.
16
17 Bug: https://bugs.gentoo.org/586446
18
19 eclass/php-ext-source-r3.eclass | 17 ++++++++++++++---
20 1 file changed, 14 insertions(+), 3 deletions(-)
21
22 diff --git a/eclass/php-ext-source-r3.eclass b/eclass/php-ext-source-r3.eclass
23 index bc6751562a5..315ce32887f 100644
24 --- a/eclass/php-ext-source-r3.eclass
25 +++ b/eclass/php-ext-source-r3.eclass
26 @@ -1,4 +1,4 @@
27 -# Copyright 1999-2016 Gentoo Foundation
28 +# Copyright 1999-2018 Gentoo Foundation
29 # Distributed under the terms of the GNU General Public License v2
30
31 # @ECLASS: php-ext-source-r3.eclass
32 @@ -73,6 +73,17 @@ esac
33 # the tree.
34 [[ -z "${PHP_EXT_SAPIS}" ]] && PHP_EXT_SAPIS="apache2 cli cgi fpm embed phpdbg"
35
36 +# @ECLASS-VARIABLE: PHP_INI_NAME
37 +# @DESCRIPTION
38 +# An optional file name of the saved ini file minis the ini extension
39 +# This allows ordering of extensions such that one is loaded before
40 +# or after another. Defaults to the PHP_EXT_NAME.
41 +# Example (produces 40-foo.ini file):
42 +# @CODE@
43 +# PHP_INI_NAME="40-foo"
44 +# @CODE@
45 +: ${PHP_INI_NAME:=${PHP_EXT_NAME}}
46 +
47
48 # Make sure at least one target is installed. First, start a USE
49 # conditional like "php?", but only when PHP_EXT_OPTIONAL_USE is
50 @@ -295,7 +306,7 @@ php_slot_ini_files() {
51 local x
52 for x in ${PHP_EXT_SAPIS} ; do
53 if [[ -f "${EPREFIX}/etc/php/${x}-${1}/php.ini" ]] ; then
54 - slot_ini_files+=" etc/php/${x}-${1}/ext/${PHP_EXT_NAME}.ini"
55 + slot_ini_files+=" etc/php/${x}-${1}/ext/${PHP_INI_NAME}.ini"
56 fi
57 done
58
59 @@ -324,7 +335,7 @@ php-ext-source-r3_createinifiles() {
60 einfo "Added contents of ${FILESDIR}/${PHP_EXT_INIFILE}" \
61 "to ${file}"
62 fi
63 - inidir="${file/${PHP_EXT_NAME}.ini/}"
64 + inidir="${file/${PHP_INI_NAME}.ini/}"
65 inidir="${inidir/ext/ext-active}"
66 dodir "/${inidir}"
67 dosym "/${file}" "/${file/ext/ext-active}"