Gentoo Archives: gentoo-commits

From: "Michal Gorny (mgorny)" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog distutils-r1.eclass python-r1.eclass
Date: Tue, 26 Feb 2013 14:33:48
Message-Id: 20130226143345.55B8D2171D@flycatcher.gentoo.org
1 mgorny 13/02/26 14:33:45
2
3 Modified: ChangeLog distutils-r1.eclass python-r1.eclass
4 Log:
5 Introduce the parallel variant of python_foreach_impl().
6
7 Revision Changes Path
8 1.686 eclass/ChangeLog
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.686&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.686&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.685&r2=1.686
13
14 Index: ChangeLog
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
17 retrieving revision 1.685
18 retrieving revision 1.686
19 diff -u -r1.685 -r1.686
20 --- ChangeLog 26 Feb 2013 14:32:49 -0000 1.685
21 +++ ChangeLog 26 Feb 2013 14:33:45 -0000 1.686
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.685 2013/02/26 14:32:49 mgorny Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.686 2013/02/26 14:33:45 mgorny Exp $
27 +
28 + 26 Feb 2013; Michał Górny <mgorny@g.o> distutils-r1.eclass,
29 + python-r1.eclass:
30 + Introduce the parallel variant of python_foreach_impl().
31
32 26 Feb 2013; Michał Górny <mgorny@g.o> python-r1.eclass:
33 Make python_foreach_impl() non-fatal, expect explicit die inside or outside.
34
35
36
37 1.55 eclass/distutils-r1.eclass
38
39 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils-r1.eclass?rev=1.55&view=markup
40 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils-r1.eclass?rev=1.55&content-type=text/plain
41 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils-r1.eclass?r1=1.54&r2=1.55
42
43 Index: distutils-r1.eclass
44 ===================================================================
45 RCS file: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v
46 retrieving revision 1.54
47 retrieving revision 1.55
48 diff -u -r1.54 -r1.55
49 --- distutils-r1.eclass 21 Feb 2013 23:18:56 -0000 1.54
50 +++ distutils-r1.eclass 26 Feb 2013 14:33:45 -0000 1.55
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.54 2013/02/21 23:18:56 mgorny Exp $
55 +# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.55 2013/02/26 14:33:45 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
75
76
77 1.42 eclass/python-r1.eclass
78
79 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-r1.eclass?rev=1.42&view=markup
80 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-r1.eclass?rev=1.42&content-type=text/plain
81 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-r1.eclass?r1=1.41&r2=1.42
82
83 Index: python-r1.eclass
84 ===================================================================
85 RCS file: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v
86 retrieving revision 1.41
87 retrieving revision 1.42
88 diff -u -r1.41 -r1.42
89 --- python-r1.eclass 26 Feb 2013 14:32:49 -0000 1.41
90 +++ python-r1.eclass 26 Feb 2013 14:33:45 -0000 1.42
91 @@ -1,6 +1,6 @@
92 # Copyright 1999-2013 Gentoo Foundation
93 # Distributed under the terms of the GNU General Public License v2
94 -# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.41 2013/02/26 14:32:49 mgorny Exp $
95 +# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.42 2013/02/26 14:33:45 mgorny Exp $
96
97 # @ECLASS: python-r1
98 # @MAINTAINER:
99 @@ -173,6 +173,14 @@
100 }
101 _python_set_globals
102
103 +# @ECLASS-VARIABLE: DISTUTILS_JOBS
104 +# @DEFAULT_UNSET
105 +# @DESCRIPTION:
106 +# The number of parallel jobs to run for distutils-r1 parallel builds.
107 +# If unset, the job-count in ${MAKEOPTS} will be used.
108 +#
109 +# This variable is intended to be set in make.conf.
110 +
111 # @FUNCTION: _python_validate_useflags
112 # @INTERNAL
113 # @DESCRIPTION:
114 @@ -623,6 +631,52 @@
115 return ${ret}
116 }
117
118 +# @FUNCTION: python_parallel_foreach_impl
119 +# @USAGE: <command> [<args>...]
120 +# @DESCRIPTION:
121 +# Run the given command for each of the enabled Python implementations.
122 +# If additional parameters are passed, they will be passed through
123 +# to the command.
124 +#
125 +# The function will return 0 status if all invocations succeed.
126 +# Otherwise, the return code from first failing invocation will
127 +# be returned.
128 +#
129 +# For each command being run, EPYTHON, PYTHON and BUILD_DIR are set
130 +# locally, and the former two are exported to the command environment.
131 +#
132 +# Multiple invocations of the command will be run in parallel, up to
133 +# DISTUTILS_JOBS (defaulting to '-j' option argument from MAKEOPTS).
134 +python_parallel_foreach_impl() {
135 + debug-print-function ${FUNCNAME} "${@}"
136 +
137 + local ret lret
138 +
139 + _python_parallel() {
140 + (
141 + multijob_child_init
142 + "${@}"
143 + ) &
144 + multijob_post_fork
145 + }
146 +
147 + local opts
148 + if [[ ${DISTUTILS_JOBS} ]]; then
149 + opts=-j${DISTUTILS_JOBS}
150 + else
151 + opts=${MAKEOPTS}
152 + fi
153 +
154 + multijob_init "${opts}"
155 + python_foreach_impl _python_parallel "${@}"
156 + ret=${?}
157 + multijob_finish
158 + lret=${?}
159 +
160 + [[ ${ret} -eq 0 ]] && ret=${lret}
161 + return ${ret}
162 +}
163 +
164 # @FUNCTION: python_export_best
165 # @USAGE: [<variable>...]
166 # @DESCRIPTION: