1 |
mgorny 13/03/04 19:28:47 |
2 |
|
3 |
Modified: ChangeLog distutils-r1.eclass python-r1.eclass |
4 |
Log: |
5 |
Introduce python_parallel_foreach_impl() and reuse it in distutils-r1. |
6 |
|
7 |
Revision Changes Path |
8 |
1.710 eclass/ChangeLog |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.710&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.710&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.709&r2=1.710 |
13 |
|
14 |
Index: ChangeLog |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v |
17 |
retrieving revision 1.709 |
18 |
retrieving revision 1.710 |
19 |
diff -u -r1.709 -r1.710 |
20 |
--- ChangeLog 4 Mar 2013 19:27:58 -0000 1.709 |
21 |
+++ ChangeLog 4 Mar 2013 19:28:47 -0000 1.710 |
22 |
@@ -1,6 +1,10 @@ |
23 |
# ChangeLog for eclass directory |
24 |
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.709 2013/03/04 19:27:58 mgorny Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.710 2013/03/04 19:28:47 mgorny Exp $ |
27 |
+ |
28 |
+ 04 Mar 2013; Michał Górny <mgorny@g.o> distutils-r1.eclass, |
29 |
+ python-r1.eclass: |
30 |
+ Introduce python_parallel_foreach_impl() and reuse it in distutils-r1. |
31 |
|
32 |
04 Mar 2013; Michał Górny <mgorny@g.o> python-r1.eclass: |
33 |
Use multibuild.eclass in python-r1. |
34 |
|
35 |
|
36 |
|
37 |
1.61 eclass/distutils-r1.eclass |
38 |
|
39 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils-r1.eclass?rev=1.61&view=markup |
40 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils-r1.eclass?rev=1.61&content-type=text/plain |
41 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils-r1.eclass?r1=1.60&r2=1.61 |
42 |
|
43 |
Index: distutils-r1.eclass |
44 |
=================================================================== |
45 |
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v |
46 |
retrieving revision 1.60 |
47 |
retrieving revision 1.61 |
48 |
diff -u -r1.60 -r1.61 |
49 |
--- distutils-r1.eclass 2 Mar 2013 07:17:50 -0000 1.60 |
50 |
+++ distutils-r1.eclass 4 Mar 2013 19:28:47 -0000 1.61 |
51 |
@@ -1,6 +1,6 @@ |
52 |
# Copyright 1999-2013 Gentoo Foundation |
53 |
# Distributed under the terms of the GNU General Public License v2 |
54 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.60 2013/03/02 07:17:50 mgorny Exp $ |
55 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.61 2013/03/04 19:28:47 mgorny Exp $ |
56 |
|
57 |
# @ECLASS: distutils-r1 |
58 |
# @MAINTAINER: |
59 |
@@ -100,14 +100,6 @@ |
60 |
DEPEND=${PYTHON_DEPS} |
61 |
fi |
62 |
|
63 |
-# @ECLASS-VARIABLE: DISTUTILS_JOBS |
64 |
-# @DEFAULT_UNSET |
65 |
-# @DESCRIPTION: |
66 |
-# The number of parallel jobs to run for distutils-r1 parallel builds. |
67 |
-# If unset, the job-count in ${MAKEOPTS} will be used. |
68 |
-# |
69 |
-# This variable is intended to be set in make.conf. |
70 |
- |
71 |
# @ECLASS-VARIABLE: PATCHES |
72 |
# @DEFAULT_UNSET |
73 |
# @DESCRIPTION: |
74 |
@@ -551,16 +543,7 @@ |
75 |
|
76 |
mkdir -p "${TMPDIR}" || die |
77 |
|
78 |
- if [[ ${DISTUTILS_NO_PARALLEL_BUILD} || ${DISTUTILS_SINGLE_IMPL} ]] |
79 |
- then |
80 |
- "${@}" 2>&1 | tee -a "${T}/build-${EPYTHON}.log" |
81 |
- else |
82 |
- ( |
83 |
- multijob_child_init |
84 |
- "${@}" 2>&1 | tee -a "${T}/build-${EPYTHON}.log" |
85 |
- ) & |
86 |
- multijob_post_fork |
87 |
- fi |
88 |
+ "${@}" |
89 |
|
90 |
if [[ ${DISTUTILS_IN_SOURCE_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]] |
91 |
then |
92 |
@@ -603,39 +586,6 @@ |
93 |
fi |
94 |
} |
95 |
|
96 |
-# @FUNCTION: _distutils-r1_multijob_init |
97 |
-# @INTERNAL |
98 |
-# @DESCRIPTION: |
99 |
-# Init multijob, taking the job-count from ${DISTUTILS_JOBS}. |
100 |
-_distutils-r1_multijob_init() { |
101 |
- debug-print-function ${FUNCNAME} "${@}" |
102 |
- |
103 |
- if [[ ! ${DISTUTILS_NO_PARALLEL_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]] |
104 |
- then |
105 |
- local opts |
106 |
- if [[ ${DISTUTILS_JOBS} ]]; then |
107 |
- opts=-j${DISTUTILS_JOBS} |
108 |
- else |
109 |
- opts=${MAKEOPTS} |
110 |
- fi |
111 |
- |
112 |
- multijob_init "${opts}" |
113 |
- fi |
114 |
-} |
115 |
- |
116 |
-# @FUNCTION: _distutils-r1_multijob_finish |
117 |
-# @INTERNAL |
118 |
-# @DESCRIPTION: |
119 |
-# Finish multijob if used. |
120 |
-_distutils-r1_multijob_finish() { |
121 |
- debug-print-function ${FUNCNAME} "${@}" |
122 |
- |
123 |
- if [[ ! ${DISTUTILS_NO_PARALLEL_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]] |
124 |
- then |
125 |
- multijob_finish |
126 |
- fi |
127 |
-} |
128 |
- |
129 |
# @FUNCTION: _distutils-r1_run_foreach_impl |
130 |
# @INTERNAL |
131 |
# @DESCRIPTION: |
132 |
@@ -647,9 +597,12 @@ |
133 |
set -- distutils-r1_run_phase "${@}" |
134 |
|
135 |
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then |
136 |
- _distutils-r1_multijob_init |
137 |
- python_foreach_impl "${@}" |
138 |
- _distutils-r1_multijob_finish |
139 |
+ if [[ ${DISTUTILS_NO_PARALLEL_BUILD} || ${DISTUTILS_SINGLE_IMPL} ]] |
140 |
+ then |
141 |
+ python_foreach_impl "${@}" |
142 |
+ else |
143 |
+ python_parallel_foreach_impl "${@}" |
144 |
+ fi |
145 |
else |
146 |
if [[ ! ${EPYTHON} ]]; then |
147 |
die "EPYTHON unset, python-single-r1_pkg_setup not called?!" |
148 |
|
149 |
|
150 |
|
151 |
1.47 eclass/python-r1.eclass |
152 |
|
153 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-r1.eclass?rev=1.47&view=markup |
154 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-r1.eclass?rev=1.47&content-type=text/plain |
155 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-r1.eclass?r1=1.46&r2=1.47 |
156 |
|
157 |
Index: python-r1.eclass |
158 |
=================================================================== |
159 |
RCS file: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v |
160 |
retrieving revision 1.46 |
161 |
retrieving revision 1.47 |
162 |
diff -u -r1.46 -r1.47 |
163 |
--- python-r1.eclass 4 Mar 2013 19:27:58 -0000 1.46 |
164 |
+++ python-r1.eclass 4 Mar 2013 19:28:47 -0000 1.47 |
165 |
@@ -1,6 +1,6 @@ |
166 |
# Copyright 1999-2013 Gentoo Foundation |
167 |
# Distributed under the terms of the GNU General Public License v2 |
168 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.46 2013/03/04 19:27:58 mgorny Exp $ |
169 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.47 2013/03/04 19:28:47 mgorny Exp $ |
170 |
|
171 |
# @ECLASS: python-r1 |
172 |
# @MAINTAINER: |
173 |
@@ -173,6 +173,14 @@ |
174 |
} |
175 |
_python_set_globals |
176 |
|
177 |
+# @ECLASS-VARIABLE: DISTUTILS_JOBS |
178 |
+# @DEFAULT_UNSET |
179 |
+# @DESCRIPTION: |
180 |
+# The number of parallel jobs to run for distutils-r1 parallel builds. |
181 |
+# If unset, the job-count in ${MAKEOPTS} will be used. |
182 |
+# |
183 |
+# This variable is intended to be set in make.conf. |
184 |
+ |
185 |
# @FUNCTION: _python_validate_useflags |
186 |
# @INTERNAL |
187 |
# @DESCRIPTION: |
188 |
@@ -634,6 +642,31 @@ |
189 |
multibuild_foreach_variant _python_multibuild_wrapper "${@}" |
190 |
} |
191 |
|
192 |
+# @FUNCTION: python_parallel_foreach_impl |
193 |
+# @USAGE: <command> [<args>...] |
194 |
+# @DESCRIPTION: |
195 |
+# Run the given command for each of the enabled Python implementations. |
196 |
+# If additional parameters are passed, they will be passed through |
197 |
+# to the command. |
198 |
+# |
199 |
+# The function will return 0 status if all invocations succeed. |
200 |
+# Otherwise, the return code from first failing invocation will |
201 |
+# be returned. |
202 |
+# |
203 |
+# For each command being run, EPYTHON, PYTHON and BUILD_DIR are set |
204 |
+# locally, and the former two are exported to the command environment. |
205 |
+# |
206 |
+# Multiple invocations of the command will be run in parallel, up to |
207 |
+# DISTUTILS_JOBS (defaulting to '-j' option argument from MAKEOPTS). |
208 |
+python_parallel_foreach_impl() { |
209 |
+ debug-print-function ${FUNCNAME} "${@}" |
210 |
+ |
211 |
+ local MULTIBUILD_JOBS=${MULTIBUILD_JOBS:-${DISTUTILS_JOBS}} |
212 |
+ local MULTIBUILD_VARIANTS |
213 |
+ _python_obtain_impls |
214 |
+ multibuild_parallel_foreach_variant _python_multibuild_wrapper "${@}" |
215 |
+} |
216 |
+ |
217 |
# @FUNCTION: python_export_best |
218 |
# @USAGE: [<variable>...] |
219 |
# @DESCRIPTION: |