/[gentoo-x86]/eclass/phpconfutils.eclass
Gentoo

Diff of /eclass/phpconfutils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.6 Revision 1.7
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/phpconfutils.eclass,v 1.6 2007/09/01 15:58:17 jokey Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/phpconfutils.eclass,v 1.7 2007/11/22 21:52:12 drac Exp $
4# 4#
5# ######################################################################## 5# ########################################################################
6# 6#
7# Based on Stuart's work on the original confutils eclass 7# Based on Stuart's work on the original confutils eclass
8# 8#
44# this eclass first 44# this eclass first
45# 45#
46 46
47phpconfutils_init() { 47phpconfutils_init() {
48 # Define wheter we shall support shared extensions or not 48 # Define wheter we shall support shared extensions or not
49 if useq "sharedext" ; then 49 if use "sharedext" ; then
50 shared="=shared" 50 shared="=shared"
51 else 51 else
52 shared="" 52 shared=""
53 fi 53 fi
54 54
95 local required_flags="$@" 95 local required_flags="$@"
96 local default_flag="$1" 96 local default_flag="$1"
97 local success="0" 97 local success="0"
98 98
99 while [[ -n "$1" ]] ; do 99 while [[ -n "$1" ]] ; do
100 if useq "$1" ; then 100 if use "$1" ; then
101 einfo "${success_msg} $1" 101 einfo "${success_msg} $1"
102 success="1" 102 success="1"
103 else 103 else
104 einfo "${fail_msg} $1" 104 einfo "${fail_msg} $1"
105 fi 105 fi
135# 135#
136 136
137phpconfutils_use_conflict() { 137phpconfutils_use_conflict() {
138 phpconfutils_sort_flags 138 phpconfutils_sort_flags
139 139
140 if ! useq "$1" && ! phpconfutils_usecheck "$1" ; then 140 if ! use "$1" && ! phpconfutils_usecheck "$1" ; then
141 return 141 return
142 fi 142 fi
143 143
144 local my_flag="$1" 144 local my_flag="$1"
145 shift 145 shift
146 146
147 local my_present="" 147 local my_present=""
148 local my_remove="" 148 local my_remove=""
149 149
150 while [[ "$1+" != "+" ]] ; do 150 while [[ "$1+" != "+" ]] ; do
151 if useq "$1" || phpconfutils_usecheck "$1" ; then 151 if use "$1" || phpconfutils_usecheck "$1" ; then
152 my_present="${my_present} $1" 152 my_present="${my_present} $1"
153 my_remove="${my_remove} -$1" 153 my_remove="${my_remove} -$1"
154 fi 154 fi
155 shift 155 shift
156 done 156 done
179# 179#
180 180
181phpconfutils_use_depend_all() { 181phpconfutils_use_depend_all() {
182 phpconfutils_sort_flags 182 phpconfutils_sort_flags
183 183
184 if ! useq "$1" && ! phpconfutils_usecheck "$1" ; then 184 if ! use "$1" && ! phpconfutils_usecheck "$1" ; then
185 return 185 return
186 fi 186 fi
187 187
188 local my_flag="$1" 188 local my_flag="$1"
189 shift 189 shift
190 190
191 local my_missing="" 191 local my_missing=""
192 192
193 while [[ "$1+" != "+" ]] ; do 193 while [[ "$1+" != "+" ]] ; do
194 if ! useq "$1" && ! phpconfutils_usecheck "$1" ; then 194 if ! use "$1" && ! phpconfutils_usecheck "$1" ; then
195 my_missing="${my_missing} $1" 195 my_missing="${my_missing} $1"
196 fi 196 fi
197 shift 197 shift
198 done 198 done
199 199
223# 223#
224 224
225phpconfutils_use_depend_any() { 225phpconfutils_use_depend_any() {
226 phpconfutils_sort_flags 226 phpconfutils_sort_flags
227 227
228 if ! useq "$1" && ! phpconfutils_usecheck "$1" ; then 228 if ! use "$1" && ! phpconfutils_usecheck "$1" ; then
229 return 229 return
230 fi 230 fi
231 231
232 local my_flag="$1" 232 local my_flag="$1"
233 shift 233 shift
237 237
238 local my_found="" 238 local my_found=""
239 local my_missing="" 239 local my_missing=""
240 240
241 while [[ "$1+" != "+" ]] ; do 241 while [[ "$1+" != "+" ]] ; do
242 if useq "$1" || phpconfutils_usecheck "$1" ; then 242 if use "$1" || phpconfutils_usecheck "$1" ; then
243 my_found="${my_found} $1" 243 my_found="${my_found} $1"
244 else 244 else
245 my_missing="${my_missing} $1" 245 my_missing="${my_missing} $1"
246 fi 246 fi
247 shift 247 shift
271# $2 - USE flag 271# $2 - USE flag
272# $3 - optional message to einfo() to the user 272# $3 - optional message to einfo() to the user
273# 273#
274 274
275phpconfutils_extension_disable() { 275phpconfutils_extension_disable() {
276 if ! useq "$2" && ! phpconfutils_usecheck "$2" ; then 276 if ! use "$2" && ! phpconfutils_usecheck "$2" ; then
277 my_conf="${my_conf} --disable-$1" 277 my_conf="${my_conf} --disable-$1"
278 [[ -n "$3" ]] && einfo " Disabling $1" 278 [[ -n "$3" ]] && einfo " Disabling $1"
279 else 279 else
280 [[ -n "$3" ]] && einfo " Enabling $1" 280 [[ -n "$3" ]] && einfo " Enabling $1"
281 fi 281 fi
311 if [[ "$4+" != "+" ]] ; then 311 if [[ "$4+" != "+" ]] ; then
312 my_shared="=$4" 312 my_shared="=$4"
313 fi 313 fi
314 fi 314 fi
315 315
316 if useq "$2" || phpconfutils_usecheck "$2" ; then 316 if use "$2" || phpconfutils_usecheck "$2" ; then
317 my_conf="${my_conf} --enable-$1${my_shared}" 317 my_conf="${my_conf} --enable-$1${my_shared}"
318 einfo " Enabling $1" 318 einfo " Enabling $1"
319 else 319 else
320 my_conf="${my_conf} --disable-$1" 320 my_conf="${my_conf} --disable-$1"
321 einfo " Disabling $1" 321 einfo " Disabling $1"
333# $2 - USE flag 333# $2 - USE flag
334# $3 - optional message to einfo() to the user 334# $3 - optional message to einfo() to the user
335# 335#
336 336
337phpconfutils_extension_without() { 337phpconfutils_extension_without() {
338 if ! useq "$2" && ! phpconfutils_usecheck "$2" ; then 338 if ! use "$2" && ! phpconfutils_usecheck "$2" ; then
339 my_conf="${my_conf} --without-$1" 339 my_conf="${my_conf} --without-$1"
340 einfo " Disabling $1" 340 einfo " Disabling $1"
341 else 341 else
342 einfo " Enabling $1" 342 einfo " Enabling $1"
343 fi 343 fi
372 if [[ "$4+" != "+" ]] ; then 372 if [[ "$4+" != "+" ]] ; then
373 my_shared="=$4" 373 my_shared="=$4"
374 fi 374 fi
375 fi 375 fi
376 376
377 if useq "$2" || phpconfutils_usecheck "$2" ; then 377 if use "$2" || phpconfutils_usecheck "$2" ; then
378 my_conf="${my_conf} --with-$1${my_shared}" 378 my_conf="${my_conf} --with-$1${my_shared}"
379 einfo " Enabling $1" 379 einfo " Enabling $1"
380 else 380 else
381 my_conf="${my_conf} --without-$1" 381 my_conf="${my_conf} --without-$1"
382 einfo " Disabling $1" 382 einfo " Disabling $1"
395 395
396 local x 396 local x
397 local my_found="0" 397 local my_found="0"
398 398
399 for x in ${PHPCONFUTILS_MISSING_DEPS} ; do 399 for x in ${PHPCONFUTILS_MISSING_DEPS} ; do
400 if useq "${x}" || phpconfutils_usecheck "${x}" ; then 400 if use "${x}" || phpconfutils_usecheck "${x}" ; then
401 ewarn "USE flag ${x} enables support for software not present in Portage!" 401 ewarn "USE flag ${x} enables support for software not present in Portage!"
402 my_found="1" 402 my_found="1"
403 fi 403 fi
404 done 404 done
405 405

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.20