1 |
arfrever 09/05/26 16:41:56 |
2 |
|
3 |
Modified: depend.apache.eclass |
4 |
Log: |
5 |
Add depend.apache_pkg_setup() and don't call use() in functions called in "depend" phase (bug #268371). |
6 |
|
7 |
Revision Changes Path |
8 |
1.45 eclass/depend.apache.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.45&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.45&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?r1=1.44&r2=1.45 |
13 |
|
14 |
Index: depend.apache.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v |
17 |
retrieving revision 1.44 |
18 |
retrieving revision 1.45 |
19 |
diff -u -r1.44 -r1.45 |
20 |
--- depend.apache.eclass 4 Mar 2008 10:59:27 -0000 1.44 |
21 |
+++ depend.apache.eclass 26 May 2009 16:41:56 -0000 1.45 |
22 |
@@ -1,6 +1,6 @@ |
23 |
-# Copyright 1999-2007 Gentoo Foundation |
24 |
+# Copyright 1999-2009 Gentoo Foundation |
25 |
# Distributed under the terms of the GNU General Public License v2 |
26 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.44 2008/03/04 10:59:27 hollow Exp $ |
27 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.45 2009/05/26 16:41:56 arfrever Exp $ |
28 |
|
29 |
# @ECLASS: depend.apache.eclass |
30 |
# @MAINTAINER: |
31 |
@@ -34,6 +34,10 @@ |
32 |
# DEPEND="server? ( virtual/Perl-CGI )" |
33 |
# RDEPEND="${DEPEND}" |
34 |
# want_apache2 server |
35 |
+# |
36 |
+# pkg_setup() { |
37 |
+# depend.apache_pkg_setup server |
38 |
+# } |
39 |
# @CODE |
40 |
|
41 |
inherit multilib |
42 |
@@ -132,11 +136,36 @@ |
43 |
# PUBLIC FUNCTIONS |
44 |
# ============================================================================== |
45 |
|
46 |
+# @FUNCTION: depend.apache_pkg_setup |
47 |
+# @USAGE: [myiuse] |
48 |
+# @DESCRIPTION: |
49 |
+# An ebuild calls this in pkg_setup() to initialize variables for optional |
50 |
+# apache-2.x support. If the myiuse parameter is not given it defaults to |
51 |
+# apache2. |
52 |
+depend.apache_pkg_setup() { |
53 |
+ debug-print-function $FUNCNAME $* |
54 |
+ |
55 |
+ if [[ "${EBUILD_PHASE}" != "setup" ]]; then |
56 |
+ die "$FUNCNAME() should be called in pkg_setup()" |
57 |
+ fi |
58 |
+ |
59 |
+ local myiuse=${1:-apache2} |
60 |
+ if has ${myiuse} ${IUSE}; then |
61 |
+ if use ${myiuse}; then |
62 |
+ _init_apache2 |
63 |
+ else |
64 |
+ _init_no_apache |
65 |
+ fi |
66 |
+ fi |
67 |
+} |
68 |
+ |
69 |
# @FUNCTION: want_apache |
70 |
# @USAGE: [myiuse] |
71 |
# @DESCRIPTION: |
72 |
# An ebuild calls this to get the dependency information for optional apache |
73 |
# support. If the myiuse parameter is not given it defaults to apache2. |
74 |
+# An ebuild should additionally call depend.apache_pkg_setup() in pkg_setup() |
75 |
+# with the same myiuse parameter. |
76 |
want_apache() { |
77 |
debug-print-function $FUNCNAME $* |
78 |
want_apache2 "$@" |
79 |
@@ -147,6 +176,8 @@ |
80 |
# @DESCRIPTION: |
81 |
# An ebuild calls this to get the dependency information for optional apache-2.x |
82 |
# support. If the myiuse parameter is not given it defaults to apache2. |
83 |
+# An ebuild should additionally call depend.apache_pkg_setup() in pkg_setup() |
84 |
+# with the same myiuse parameter. |
85 |
want_apache2() { |
86 |
debug-print-function $FUNCNAME $* |
87 |
|
88 |
@@ -154,12 +185,6 @@ |
89 |
IUSE="${IUSE} ${myiuse}" |
90 |
DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_DEPEND} )" |
91 |
RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_DEPEND} )" |
92 |
- |
93 |
- if use ${myiuse}; then |
94 |
- _init_apache2 |
95 |
- else |
96 |
- _init_no_apache |
97 |
- fi |
98 |
} |
99 |
|
100 |
# @FUNCTION: want_apache2_2 |
101 |
@@ -168,6 +193,8 @@ |
102 |
# An ebuild calls this to get the dependency information for optional |
103 |
# apache-2.2.x support. If the myiuse parameter is not given it defaults to |
104 |
# apache2. |
105 |
+# An ebuild should additionally call depend.apache_pkg_setup() in pkg_setup() |
106 |
+# with the same myiuse parameter. |
107 |
want_apache2_2() { |
108 |
debug-print-function $FUNCNAME $* |
109 |
|
110 |
@@ -175,12 +202,6 @@ |
111 |
IUSE="${IUSE} ${myiuse}" |
112 |
DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )" |
113 |
RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )" |
114 |
- |
115 |
- if use ${myiuse}; then |
116 |
- _init_apache2 |
117 |
- else |
118 |
- _init_no_apache |
119 |
- fi |
120 |
} |
121 |
|
122 |
# @FUNCTION: need_apache |
123 |
@@ -275,3 +296,5 @@ |
124 |
die "Need missing USE flag '${myflag}' in ${myforeign}" |
125 |
fi |
126 |
} |
127 |
+ |
128 |
+EXPORT_FUNCTIONS pkg_setup |