public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Brian Evans <grknight@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: Brian Evans <grknight@gentoo.org>
Subject: [gentoo-dev] [PATCH 1/2] php-ext-source-r3.eclass: Introduce PHP_INI_NAME variable
Date: Fri, 26 Jan 2018 10:38:56 -0500	[thread overview]
Message-ID: <20180126153857.30315-2-grknight@gentoo.org> (raw)
In-Reply-To: <20180126153857.30315-1-grknight@gentoo.org>

Currently php-ext-source-r3 saves the enabling ini file as
"${PHP_EXT_NAME}.ini".  This is problematic when foo module needs to be
loaded before bar module as things are read in directory order.

This patch introduces PHP_INI_NAME which defaults to PHP_EXT_NAME for
backwards-compatibility.
---
 eclass/php-ext-source-r3.eclass | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/eclass/php-ext-source-r3.eclass b/eclass/php-ext-source-r3.eclass
index bc6751562a5..315ce32887f 100644
--- a/eclass/php-ext-source-r3.eclass
+++ b/eclass/php-ext-source-r3.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: php-ext-source-r3.eclass
@@ -73,6 +73,17 @@ esac
 # the tree.
 [[ -z "${PHP_EXT_SAPIS}" ]] && PHP_EXT_SAPIS="apache2 cli cgi fpm embed phpdbg"
 
+# @ECLASS-VARIABLE: PHP_INI_NAME
+# @DESCRIPTION
+# An optional file name of the saved ini file minis the ini extension
+# This allows ordering of extensions such that one is loaded before
+# or after another.  Defaults to the PHP_EXT_NAME.
+# Example (produces 40-foo.ini file):
+# @CODE@
+# PHP_INI_NAME="40-foo"
+# @CODE@
+: ${PHP_INI_NAME:=${PHP_EXT_NAME}}
+
 
 # Make sure at least one target is installed. First, start a USE
 # conditional like "php?", but only when PHP_EXT_OPTIONAL_USE is
@@ -295,7 +306,7 @@ php_slot_ini_files() {
 	local x
 	for x in ${PHP_EXT_SAPIS} ; do
 		if [[ -f "${EPREFIX}/etc/php/${x}-${1}/php.ini" ]] ; then
-			slot_ini_files+=" etc/php/${x}-${1}/ext/${PHP_EXT_NAME}.ini"
+			slot_ini_files+=" etc/php/${x}-${1}/ext/${PHP_INI_NAME}.ini"
 		fi
 	done
 
@@ -324,7 +335,7 @@ php-ext-source-r3_createinifiles() {
 				einfo "Added contents of ${FILESDIR}/${PHP_EXT_INIFILE}" \
 					  "to ${file}"
 			fi
-			inidir="${file/${PHP_EXT_NAME}.ini/}"
+			inidir="${file/${PHP_INI_NAME}.ini/}"
 			inidir="${inidir/ext/ext-active}"
 			dodir "/${inidir}"
 			dosym "/${file}" "/${file/ext/ext-active}"
-- 
2.16.1



  reply	other threads:[~2018-01-26 15:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-26 15:38 [gentoo-dev] [RFC] php-ext-source-r3 eclass improvements Brian Evans
2018-01-26 15:38 ` Brian Evans [this message]
2018-01-26 15:38 ` [gentoo-dev] [PATCH 2/2] php-ext-source-r3.eclass: Introduce PHP_EXT_NEEDED_USE Brian Evans
2018-01-29 13:50 ` [gentoo-dev] [RFC] php-ext-source-r3 eclass improvements Brian Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180126153857.30315-2-grknight@gentoo.org \
    --to=grknight@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox