| 1 | # Copyright 1999-2007 Gentoo Foundation |
1 | # Copyright 1999-2007 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-base-r1.eclass,v 1.8 2007/09/01 15:58:17 jokey Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-base-r1.eclass,v 1.9 2007/11/29 23:12:13 jokey Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Tal Peer <coredumb@gentoo.org> |
5 | # Author: Tal Peer <coredumb@gentoo.org> |
| 6 | # Author: Stuart Herbert <stuart@gentoo.org> |
6 | # Author: Stuart Herbert <stuart@gentoo.org> |
| 7 | # Author: Luca Longinotti <chtekk@gentoo.org> |
7 | # Author: Luca Longinotti <chtekk@gentoo.org> |
| 8 | # Author: Jakub Moc <jakub@gentoo.org> (documentation) |
8 | # Author: Jakub Moc <jakub@gentoo.org> (documentation) |
| … | |
… | |
| 116 | # $1 - Setting name |
116 | # $1 - Setting name |
| 117 | # $2 - Setting value |
117 | # $2 - Setting value |
| 118 | # $3 - File to add to |
118 | # $3 - File to add to |
| 119 | # $4 - Sanitized text to output |
119 | # $4 - Sanitized text to output |
| 120 | php-ext-base-r1_addtoinifile() { |
120 | php-ext-base-r1_addtoinifile() { |
| 121 | if [[ ! -d `dirname $3` ]] ; then |
121 | if [[ ! -d $(dirname $3) ]] ; then |
| 122 | mkdir -p `dirname $3` |
122 | mkdir -p $(dirname $3) |
| 123 | fi |
123 | fi |
| 124 | |
124 | |
| 125 | # Are we adding the name of a section? |
125 | # Are we adding the name of a section? |
| 126 | if [[ ${1:0:1} == "[" ]] ; then |
126 | if [[ ${1:0:1} == "[" ]] ; then |
| 127 | echo "$1" >> "$3" |
127 | echo "$1" >> "$3" |
| … | |
… | |
| 135 | einfo "Added '$my_added' to /$3" |
135 | einfo "Added '$my_added' to /$3" |
| 136 | else |
136 | else |
| 137 | einfo "$4 to /$3" |
137 | einfo "$4 to /$3" |
| 138 | fi |
138 | fi |
| 139 | |
139 | |
| 140 | insinto /`dirname $3` |
140 | insinto /$(dirname $3) |
| 141 | doins "$3" |
141 | doins "$3" |
| 142 | } |
142 | } |
| 143 | |
143 | |
| 144 | # @FUNCTION: php-ext-base-r1_addtoinifiles |
144 | # @FUNCTION: php-ext-base-r1_addtoinifiles |
| 145 | # @USAGE: <setting name> <setting value> [message to output]; or just [section name] |
145 | # @USAGE: <setting name> <setting value> [message to output]; or just [section name] |