1 |
arfrever 09/08/05 18:31:30 |
2 |
|
3 |
Modified: python.eclass |
4 |
Log: |
5 |
Rename get_python() to PYTHON(). Set BUILDDIR in python_execute_function(). |
6 |
|
7 |
Revision Changes Path |
8 |
1.60 eclass/python.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.eclass?rev=1.60&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.eclass?rev=1.60&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.eclass?r1=1.59&r2=1.60 |
13 |
|
14 |
Index: python.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/python.eclass,v |
17 |
retrieving revision 1.59 |
18 |
retrieving revision 1.60 |
19 |
diff -u -r1.59 -r1.60 |
20 |
--- python.eclass 4 Aug 2009 21:01:25 -0000 1.59 |
21 |
+++ python.eclass 5 Aug 2009 18:31:30 -0000 1.60 |
22 |
@@ -1,6 +1,6 @@ |
23 |
# Copyright 1999-2009 Gentoo Foundation |
24 |
# Distributed under the terms of the GNU General Public License v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.59 2009/08/04 21:01:25 arfrever Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.60 2009/08/05 18:31:30 arfrever Exp $ |
27 |
|
28 |
# @ECLASS: python.eclass |
29 |
# @MAINTAINER: |
30 |
@@ -66,12 +66,12 @@ |
31 |
__python_version_extract $PYVER_ALL |
32 |
} |
33 |
|
34 |
-# @FUNCTION: get_python |
35 |
+# @FUNCTION: PYTHON |
36 |
# @USAGE: [-a|--absolute-path] <Python_ABI="${PYTHON_ABI}"> |
37 |
# @DESCRIPTION: |
38 |
# Get Python interpreter filename for specified Python ABI. If Python_ABI argument |
39 |
# is ommitted, then PYTHON_ABI environment variable must be set and is used. |
40 |
-get_python() { |
41 |
+PYTHON() { |
42 |
local absolute_path="0" slot= |
43 |
|
44 |
while (($#)); do |
45 |
@@ -189,8 +189,8 @@ |
46 |
# @FUNCTION: python_execute_function |
47 |
# @USAGE: [--action-message message] [-d|--default-function] [--failure-message message] [--nonfatal] [-q|--quiet] [-s|--separate-build-dirs] <function> [arguments] |
48 |
# @DESCRIPTION: |
49 |
-# Execute specified function for each value of PYTHON_ABIS, optionally passing |
50 |
-# additional arguments. The specified function can use PYTHON_ABI variable. |
51 |
+# Execute specified function for each value of PYTHON_ABIS, optionally passing additional |
52 |
+# arguments. The specified function can use PYTHON_ABI and BUILDDIR variables. |
53 |
python_execute_function() { |
54 |
local action action_message action_message_template= default_function="0" failure_message failure_message_template= function nonfatal="0" PYTHON_ABI quiet="0" separate_build_dirs="0" |
55 |
|
56 |
@@ -304,9 +304,12 @@ |
57 |
echo " ${GREEN}*${NORMAL} ${BLUE}${action_message}${NORMAL}" |
58 |
fi |
59 |
if [[ "${separate_build_dirs}" == "1" ]]; then |
60 |
- pushd "${S}-${PYTHON_ABI}" > /dev/null || die "pushd failed" |
61 |
+ export BUILDDIR="${S}-${PYTHON_ABI}" |
62 |
+ pushd "${BUILDDIR}" > /dev/null || die "pushd failed" |
63 |
+ else |
64 |
+ export BUILDDIR="${S}" |
65 |
fi |
66 |
- if ! EPYTHON="$(get_python)" "${function}" "$@"; then |
67 |
+ if ! EPYTHON="$(PYTHON)" "${function}" "$@"; then |
68 |
if [[ -n "${failure_message_template}" ]]; then |
69 |
failure_message="$(eval echo -n "${failure_message_template}")" |
70 |
else |
71 |
@@ -328,6 +331,7 @@ |
72 |
if [[ "${separate_build_dirs}" == "1" ]]; then |
73 |
popd > /dev/null || die "popd failed" |
74 |
fi |
75 |
+ unset BUILDDIR |
76 |
done |
77 |
|
78 |
if [[ "${default_function}" == "1" ]]; then |
79 |
@@ -635,15 +639,15 @@ |
80 |
for dir in "${site_packages_dirs[@]}"; do |
81 |
site_packages_absolute_dirs+=("${root}/$(python_get_sitedir)/${dir}") |
82 |
done |
83 |
- "$(get_python)" "${root}/$(python_get_libdir)/compileall.py" "${options[@]}" "${site_packages_absolute_dirs[@]}" || return_code="1" |
84 |
- "$(get_python)" -O "${root}/$(python_get_libdir)/compileall.py" "${options[@]}" "${site_packages_absolute_dirs[@]}" || return_code="1" |
85 |
+ "$(PYTHON)" "${root}/$(python_get_libdir)/compileall.py" "${options[@]}" "${site_packages_absolute_dirs[@]}" || return_code="1" |
86 |
+ "$(PYTHON)" -O "${root}/$(python_get_libdir)/compileall.py" "${options[@]}" "${site_packages_absolute_dirs[@]}" || return_code="1" |
87 |
fi |
88 |
if ((${#site_packages_files[@]})); then |
89 |
for file in "${site_packages_files[@]}"; do |
90 |
site_packages_absolute_files+=("${root}/$(python_get_sitedir)/${file}") |
91 |
done |
92 |
- "$(get_python)" "${root}/$(python_get_libdir)/py_compile.py" "${site_packages_absolute_files[@]}" || return_code="1" |
93 |
- "$(get_python)" -O "${root}/$(python_get_libdir)/py_compile.py" "${site_packages_absolute_files[@]}" || return_code="1" |
94 |
+ "$(PYTHON)" "${root}/$(python_get_libdir)/py_compile.py" "${site_packages_absolute_files[@]}" || return_code="1" |
95 |
+ "$(PYTHON)" -O "${root}/$(python_get_libdir)/py_compile.py" "${site_packages_absolute_files[@]}" || return_code="1" |
96 |
fi |
97 |
eend "${return_code}" |
98 |
fi |