From c974a018428c49379270cbc882a4585d67fcba90 Mon Sep 17 00:00:00 2001 From: Ole Markus With Date: Mon, 15 Aug 2011 12:48:27 +0000 Subject: [PATCH] Fixed a bug with ini files and multiple slots (bug 379127) --- eclass/php-ext-source-r2.eclass | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/eclass/php-ext-source-r2.eclass b/eclass/php-ext-source-r2.eclass index b9c40edf359c..5e6dfa9208ef 100644 --- a/eclass/php-ext-source-r2.eclass +++ b/eclass/php-ext-source-r2.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r2.eclass,v 1.12 2011/07/22 12:13:27 olemarkus Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r2.eclass,v 1.13 2011/08/15 12:48:27 olemarkus Exp $ # # Author: Tal Peer # Author: Stuart Herbert @@ -247,19 +247,21 @@ php-ext-source-r2_createinifiles() { # Build the list of .ini files to edit/add to php-ext-source-r2_buildinilist ${slot} - PHPFULLINIFILELISTbak="${PHPFULLINIFILELIST}" - PHPFULLINIFILELIST="${PHPINIFILELIST}" + # Add the needed lines to the .ini files + local file if [[ "${PHP_EXT_INI}" = "yes" ]] ; then - php-ext-source-r2_addextension "${PHP_EXT_NAME}.so" + for file in ${PHPINIFILELIST}; do + php-ext-source-r2_addextension "${PHP_EXT_NAME}.so" "${file}" + done fi - PHPFULLINIFILELIST=${PHPFULLINIFILELISTbak} # Symlink the .ini files from ext/ to ext-active/ + local inifile for inifile in ${PHPINIFILELIST} ; do if [[ -n "${PHP_EXT_INIFILE}" ]]; then - cat "${FILESDIR}/${PHP_EXT_INIFILE}" >> "${D}/${inifile}" + cat "${FILESDIR}/${PHP_EXT_INIFILE}" > "${inifile}" einfo "Added content of ${FILESDIR}/${PHP_EXT_INIFILE} to ${inifile}" fi @@ -272,7 +274,6 @@ php-ext-source-r2_createinifiles() { dosym "/${inifile}" "/${inifile/ext/ext-active}" done - # Add support for installing PHP files into a version dependant directory PHP_EXT_SHARED_DIR="/usr/share/php/${PHP_EXT_NAME}" done @@ -312,7 +313,7 @@ php-ext-source-r2_addextension() { ext_file="${1}" fi - php-ext-source-r2_addtoinifiles "${ext_type}" "${ext_file}" "Extension added" + php-ext-source-r2_addtoinifile "${ext_type}" "${ext_file}" "${2}" "Extension added" } # $1 - Setting name @@ -320,16 +321,17 @@ php-ext-source-r2_addextension() { # $3 - File to add to # $4 - Sanitized text to output php-ext-source-r2_addtoinifile() { - if [[ ! -d $(dirname ${3}) ]] ; then - mkdir -p $(dirname ${3}) + local inifile="${WORKDIR}/${3}" + if [[ ! -d $(dirname ${inifile}) ]] ; then + mkdir -p $(dirname ${inifile}) fi # Are we adding the name of a section? if [[ ${1:0:1} == "[" ]] ; then - echo "${1}" >> "${3}" + echo "${1}" >> "${inifile}" my_added="${1}" else - echo "${1}=${2}" >> "${3}" + echo "${1}=${2}" >> "${inifile}" my_added="${1}=${2}" fi @@ -340,7 +342,7 @@ php-ext-source-r2_addtoinifile() { fi insinto /$(dirname ${3}) - doins "${3}" + doins "${inifile}" } # @FUNCTION: php-ext-source-r2_addtoinifiles -- 2.26.2