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

Diff of /eclass/distutils.eclass

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

Revision 1.73 Revision 1.76
1# Copyright 1999-2010 Gentoo Foundation 1# Copyright 1999-2010 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/distutils.eclass,v 1.73 2010/02/28 11:52:22 arfrever Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.76 2010/07/17 23:03:29 arfrever Exp $
4 4
5# @ECLASS: distutils.eclass 5# @ECLASS: distutils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Gentoo Python Project <python@gentoo.org> 7# Gentoo Python Project <python@gentoo.org>
8# 8#
20 *) 20 *)
21 EXPORT_FUNCTIONS src_prepare src_compile src_install pkg_postinst pkg_postrm 21 EXPORT_FUNCTIONS src_prepare src_compile src_install pkg_postinst pkg_postrm
22 ;; 22 ;;
23esac 23esac
24 24
25if [[ -z "${PYTHON_DEPEND}" ]]; then 25if [[ -z "$(declare -p PYTHON_DEPEND 2> /dev/null)" ]]; then
26 DEPEND="dev-lang/python" 26 DEPEND="dev-lang/python"
27 RDEPEND="${DEPEND}" 27 RDEPEND="${DEPEND}"
28fi 28fi
29 29
30# 'python' variable is deprecated. Use PYTHON() instead.
30if has "${EAPI:-0}" 0 1 2 && [[ -z "${SUPPORT_PYTHON_ABIS}" ]]; then 31if has "${EAPI:-0}" 0 1 2 && [[ -z "${SUPPORT_PYTHON_ABIS}" ]]; then
31 python="python" 32 python="python"
32else 33else
33 # Use "$(PYTHON)" instead of "${python}".
34 python="die" 34 python="die"
35fi 35fi
36 36
37# @ECLASS-VARIABLE: DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES 37# @ECLASS-VARIABLE: DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES
38# @DESCRIPTION: 38# @DESCRIPTION:
39# Set this to use separate source directories for each enabled version of Python. 39# Set this to use separate source directories for each enabled version of Python.
40 40
41# @ECLASS-VARIABLE: DISTUTILS_SETUP_FILES
42# @DESCRIPTION:
43# Paths to setup files.
44
41# @ECLASS-VARIABLE: DISTUTILS_GLOBAL_OPTIONS 45# @ECLASS-VARIABLE: DISTUTILS_GLOBAL_OPTIONS
42# @DESCRIPTION: 46# @DESCRIPTION:
43# Global options passed to setup.py. 47# Global options passed to setup files.
44 48
45# @ECLASS-VARIABLE: DISTUTILS_SRC_TEST 49# @ECLASS-VARIABLE: DISTUTILS_SRC_TEST
46# @DESCRIPTION: 50# @DESCRIPTION:
47# Type of test command used by distutils_src_test(). 51# Type of test command used by distutils_src_test().
48# IUSE and DEPEND are automatically adjusted, unless DISTUTILS_DISABLE_TEST_DEPENDENCY is set. 52# IUSE and DEPEND are automatically adjusted, unless DISTUTILS_DISABLE_TEST_DEPENDENCY is set.
83# Set this to disable renaming of Python scripts containing versioned shebangs 87# Set this to disable renaming of Python scripts containing versioned shebangs
84# and generation of wrapper scripts. 88# and generation of wrapper scripts.
85 89
86# @ECLASS-VARIABLE: DISTUTILS_NONVERSIONED_PYTHON_SCRIPTS 90# @ECLASS-VARIABLE: DISTUTILS_NONVERSIONED_PYTHON_SCRIPTS
87# @DESCRIPTION: 91# @DESCRIPTION:
88# List of paths to Python scripts, relative to ${D}, which are excluded from 92# List of paths to Python scripts, relative to ${ED}, which are excluded from
89# renaming and generation of wrapper scripts. 93# renaming and generation of wrapper scripts.
90 94
91# @ECLASS-VARIABLE: DOCS 95# @ECLASS-VARIABLE: DOCS
92# @DESCRIPTION: 96# @DESCRIPTION:
93# Additional documentation files installed by distutils_src_install(). 97# Additional documentation files installed by distutils_src_install().
178 182
179 if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then 183 if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
180 distutils_building() { 184 distutils_building() {
181 _distutils_hook pre 185 _distutils_hook pre
182 186
187 local setup_file
188 for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
183 echo ${_BOLD}"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@"${_NORMAL} 189 echo ${_BOLD}"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@"${_NORMAL}
184 "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@" || return "$?" 190 "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@" || return "$?"
191 done
185 192
186 _distutils_hook post 193 _distutils_hook post
187 } 194 }
188 python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_building "$@" 195 python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_building "$@"
189 else 196 else
197 local setup_file
198 for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
190 echo ${_BOLD}"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"${_NORMAL} 199 echo ${_BOLD}"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"${_NORMAL}
191 "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed" 200 "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed"
201 done
202 fi
203}
204
205_distutils_src_test_hook() {
206 if [[ "$#" -ne 1 ]]; then
207 die "${FUNCNAME}() requires 1 arguments"
208 fi
209
210 if [[ -z "${SUPPORT_PYTHON_ABIS}" ]]; then
211 return
212 fi
213
214 if [[ "$(type -t "distutils_src_test_pre_hook")" == "function" ]]; then
215 eval "python_execute_$1_pre_hook() {
216 distutils_src_test_pre_hook
217 }"
218 fi
219
220 if [[ "$(type -t "distutils_src_test_post_hook")" == "function" ]]; then
221 eval "python_execute_$1_post_hook() {
222 distutils_src_test_post_hook
223 }"
192 fi 224 fi
193} 225}
194 226
195# @FUNCTION: distutils_src_test 227# @FUNCTION: distutils_src_test
196# @DESCRIPTION: 228# @DESCRIPTION:
197# The distutils src_test function. This function is exported, when DISTUTILS_SRC_TEST variable is set. 229# The distutils src_test function. This function is exported, when DISTUTILS_SRC_TEST variable is set.
230# In ebuilds of packages supporting installation for multiple versions of Python, this function
231# calls distutils_src_test_pre_hook() and distutils_src_test_post_hook(), if they are defined.
198distutils_src_test() { 232distutils_src_test() {
233 if [[ "${EBUILD_PHASE}" != "test" ]]; then
234 die "${FUNCNAME}() can be used only in src_test() phase"
235 fi
236
199 _python_set_color_variables 237 _python_set_color_variables
200 238
201 if [[ "${DISTUTILS_SRC_TEST}" == "setup.py" ]]; then 239 if [[ "${DISTUTILS_SRC_TEST}" == "setup.py" ]]; then
202 if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then 240 if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
203 distutils_testing() { 241 distutils_testing() {
242 _distutils_hook pre
243
244 local setup_file
245 for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
204 echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@"${_NORMAL} 246 echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@"${_NORMAL}
205 PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@" 247 PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@" || return "$?"
248 done
249
250 _distutils_hook post
206 } 251 }
207 python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_testing "$@" 252 python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_testing "$@"
208 else 253 else
254 local setup_file
255 for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
209 echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@"${_NORMAL} 256 echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@"${_NORMAL}
210 PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed" 257 PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed"
258 done
211 fi 259 fi
212 elif [[ "${DISTUTILS_SRC_TEST}" == "nosetests" ]]; then 260 elif [[ "${DISTUTILS_SRC_TEST}" == "nosetests" ]]; then
261 _distutils_src_test_hook nosetests
262
213 python_execute_nosetests -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- "$@" 263 python_execute_nosetests -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- "$@"
214 elif [[ "${DISTUTILS_SRC_TEST}" == "py.test" ]]; then 264 elif [[ "${DISTUTILS_SRC_TEST}" == "py.test" ]]; then
265 _distutils_src_test_hook py.test
266
215 python_execute_py.test -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- "$@" 267 python_execute_py.test -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- "$@"
216 # trial requires an argument, which is usually equal to "${PN}". 268 # trial requires an argument, which is usually equal to "${PN}".
217 elif [[ "${DISTUTILS_SRC_TEST}" =~ ^trial(\ .*)?$ ]]; then 269 elif [[ "${DISTUTILS_SRC_TEST}" =~ ^trial(\ .*)?$ ]]; then
218 local trial_arguments 270 local trial_arguments
219 if [[ "${DISTUTILS_SRC_TEST}" == "trial "* ]]; then 271 if [[ "${DISTUTILS_SRC_TEST}" == "trial "* ]]; then
220 trial_arguments="${DISTUTILS_SRC_TEST#trial }" 272 trial_arguments="${DISTUTILS_SRC_TEST#trial }"
221 else 273 else
222 trial_arguments="${PN}" 274 trial_arguments="${PN}"
223 fi 275 fi
224 276
277 _distutils_src_test_hook trial
278
225 python_execute_trial -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- ${trial_arguments} "$@" 279 python_execute_trial -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- ${trial_arguments} "$@"
226 else 280 else
227 die "'DISTUTILS_SRC_TEST' variable has unsupported value '${DISTUTILS_SRC_TEST}'" 281 die "'DISTUTILS_SRC_TEST' variable has unsupported value '${DISTUTILS_SRC_TEST}'"
228 fi 282 fi
229} 283}
238distutils_src_install() { 292distutils_src_install() {
239 if [[ "${EBUILD_PHASE}" != "install" ]]; then 293 if [[ "${EBUILD_PHASE}" != "install" ]]; then
240 die "${FUNCNAME}() can be used only in src_install() phase" 294 die "${FUNCNAME}() can be used only in src_install() phase"
241 fi 295 fi
242 296
297 _python_initialize_prefix_variables
243 _python_set_color_variables 298 _python_set_color_variables
244 299
245 if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then 300 if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
246 if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge 4 ]]; then 301 if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge 4 ]]; then
247 declare -A wrapper_scripts=() 302 declare -A wrapper_scripts=()
248 303
249 rename_scripts_with_versioned_shebangs() { 304 rename_scripts_with_versioned_shebangs() {
250 if [[ -d "${D}usr/bin" ]]; then 305 if [[ -d "${ED}usr/bin" ]]; then
251 cd "${D}usr/bin" 306 cd "${ED}usr/bin"
252 307
253 local nonversioned_file file 308 local nonversioned_file file
254 for file in *; do 309 for file in *; do
255 if [[ -f "${file}" && ! "${file}" =~ [[:digit:]]+\.[[:digit:]](-jython)?+$ && "$(head -n1 "${file}")" =~ ^'#!'.*(python|jython-)[[:digit:]]+\.[[:digit:]]+ ]]; then 310 if [[ -f "${file}" && ! "${file}" =~ [[:digit:]]+\.[[:digit:]](-jython)?+$ && "$(head -n1 "${file}")" =~ ^'#!'.*(python|jython-)[[:digit:]]+\.[[:digit:]]+ ]]; then
256 for nonversioned_file in "${DISTUTILS_NONVERSIONED_PYTHON_SCRIPTS[@]}"; do 311 for nonversioned_file in "${DISTUTILS_NONVERSIONED_PYTHON_SCRIPTS[@]}"; do
257 [[ "${nonversioned_file}" == "/usr/bin/${file}" ]] && continue 2 312 [[ "${nonversioned_file}" == "/usr/bin/${file}" ]] && continue 2
258 done 313 done
259 mv "${file}" "${file}-${PYTHON_ABI}" || die "Renaming of '${file}' failed" 314 mv "${file}" "${file}-${PYTHON_ABI}" || die "Renaming of '${file}' failed"
260 wrapper_scripts+=(["${D}usr/bin/${file}"]=) 315 wrapper_scripts+=(["${ED}usr/bin/${file}"]=)
261 fi 316 fi
262 done 317 done
263 fi 318 fi
264 } 319 }
265 fi 320 fi
266 321
267 distutils_installation() { 322 distutils_installation() {
268 _distutils_hook pre 323 _distutils_hook pre
269 324
325 local setup_file
326 for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
270 echo ${_BOLD}"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --root="${D}" --no-compile "$@"${_NORMAL} 327 echo ${_BOLD}"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --root="${D}" --no-compile "$@"${_NORMAL}
271 "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --root="${D}" --no-compile "$@" || return "$?" 328 "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --root="${D}" --no-compile "$@" || return "$?"
329 done
272 330
273 if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge 4 ]]; then 331 if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge 4 ]]; then
274 rename_scripts_with_versioned_shebangs 332 rename_scripts_with_versioned_shebangs
275 fi 333 fi
276 334
284 unset wrapper_scripts 342 unset wrapper_scripts
285 else 343 else
286 # Mark the package to be rebuilt after a Python upgrade. 344 # Mark the package to be rebuilt after a Python upgrade.
287 python_need_rebuild 345 python_need_rebuild
288 346
347 local setup_file
348 for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
289 echo ${_BOLD}"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"${_NORMAL} 349 echo ${_BOLD}"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"${_NORMAL}
290 "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed" 350 "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed"
351 done
291 fi 352 fi
292 353
293 if [[ -e "${D}usr/local" ]]; then 354 if [[ -e "${ED}usr/local" ]]; then
294 die "Illegal installation into /usr/local" 355 die "Illegal installation into /usr/local"
295 fi 356 fi
296 357
297 local default_docs 358 local default_docs
298 default_docs="AUTHORS Change* CHANGELOG CONTRIBUTORS KNOWN_BUGS MAINTAINERS MANIFEST* NEWS PKG-INFO README* TODO" 359 default_docs="AUTHORS Change* CHANGELOG CONTRIBUTORS KNOWN_BUGS MAINTAINERS MANIFEST* NEWS PKG-INFO README* TODO"
316distutils_pkg_postinst() { 377distutils_pkg_postinst() {
317 if [[ "${EBUILD_PHASE}" != "postinst" ]]; then 378 if [[ "${EBUILD_PHASE}" != "postinst" ]]; then
318 die "${FUNCNAME}() can be used only in pkg_postinst() phase" 379 die "${FUNCNAME}() can be used only in pkg_postinst() phase"
319 fi 380 fi
320 381
382 _python_initialize_prefix_variables
383
321 local pylibdir pymod 384 local pylibdir pymod
322 if [[ -z "${PYTHON_MODNAME}" ]]; then 385 if [[ -z "$(declare -p PYTHON_MODNAME 2> /dev/null)" ]]; then
323 for pylibdir in "${ROOT}"usr/$(get_libdir)/python* "${ROOT}"/usr/share/jython-*/Lib; do 386 for pylibdir in "${EROOT}"usr/$(get_libdir)/python* "${EROOT}"/usr/share/jython-*/Lib; do
324 if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then 387 if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then
325 PYTHON_MODNAME="${PN}" 388 PYTHON_MODNAME="${PN}"
326 fi 389 fi
327 done 390 done
328 fi 391 fi
329 392
393 if [[ -n "${PYTHON_MODNAME}" ]]; then
330 if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then 394 if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
331 python_mod_optimize ${PYTHON_MODNAME} 395 python_mod_optimize ${PYTHON_MODNAME}
332 else 396 else
333 for pymod in ${PYTHON_MODNAME}; do 397 for pymod in ${PYTHON_MODNAME}; do
334 python_mod_optimize "$(python_get_sitedir)/${pymod}" 398 python_mod_optimize "$(python_get_sitedir)/${pymod}"
335 done 399 done
400 fi
336 fi 401 fi
337} 402}
338 403
339# @FUNCTION: distutils_pkg_postrm 404# @FUNCTION: distutils_pkg_postrm
340# @DESCRIPTION: 405# @DESCRIPTION:
345distutils_pkg_postrm() { 410distutils_pkg_postrm() {
346 if [[ "${EBUILD_PHASE}" != "postrm" ]]; then 411 if [[ "${EBUILD_PHASE}" != "postrm" ]]; then
347 die "${FUNCNAME}() can be used only in pkg_postrm() phase" 412 die "${FUNCNAME}() can be used only in pkg_postrm() phase"
348 fi 413 fi
349 414
415 _python_initialize_prefix_variables
416
350 local pylibdir pymod 417 local pylibdir pymod
351 if [[ -z "${PYTHON_MODNAME}" ]]; then 418 if [[ -z "$(declare -p PYTHON_MODNAME 2> /dev/null)" ]]; then
352 for pylibdir in "${ROOT}"usr/$(get_libdir)/python* "${ROOT}"/usr/share/jython-*/Lib; do 419 for pylibdir in "${EROOT}"usr/$(get_libdir)/python* "${EROOT}"/usr/share/jython-*/Lib; do
353 if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then 420 if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then
354 PYTHON_MODNAME="${PN}" 421 PYTHON_MODNAME="${PN}"
355 fi 422 fi
356 done 423 done
357 fi 424 fi
359 if [[ -n "${PYTHON_MODNAME}" ]]; then 426 if [[ -n "${PYTHON_MODNAME}" ]]; then
360 if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then 427 if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
361 python_mod_cleanup ${PYTHON_MODNAME} 428 python_mod_cleanup ${PYTHON_MODNAME}
362 else 429 else
363 for pymod in ${PYTHON_MODNAME}; do 430 for pymod in ${PYTHON_MODNAME}; do
364 for pylibdir in "${ROOT}"usr/$(get_libdir)/python*; do 431 for pylibdir in "${EROOT}"usr/$(get_libdir)/python*; do
365 if [[ -d "${pylibdir}/site-packages/${pymod}" ]]; then 432 if [[ -d "${pylibdir}/site-packages/${pymod}" ]]; then
366 python_mod_cleanup "${pylibdir#${ROOT%/}}/site-packages/${pymod}" 433 python_mod_cleanup "${pylibdir#${EROOT%/}}/site-packages/${pymod}"
367 fi 434 fi
368 done 435 done
369 done 436 done
370 fi 437 fi
371 else
372 python_mod_cleanup
373 fi 438 fi
374} 439}
375 440
376# @FUNCTION: distutils_python_version 441# Scheduled for deletion on 2011-01-01.
377# @DESCRIPTION:
378# Deprecated wrapper function for deprecated python_version().
379distutils_python_version() { 442distutils_python_version() {
380 if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then 443 eerror "Use PYTHON() instead of python variable. Use python_get_*() instead of PYVER* variables."
381 eerror "Use PYTHON() and/or python_get_*() instead of ${FUNCNAME}()." 444 die "${FUNCNAME}() is banned"
382 die "${FUNCNAME}() cannot be used in this EAPI"
383 fi
384
385 python_version
386} 445}
387 446
388# @FUNCTION: distutils_python_tkinter 447# Scheduled for deletion on 2011-01-01.
389# @DESCRIPTION:
390# Deprecated wrapper function for deprecated python_tkinter_exists().
391distutils_python_tkinter() { 448distutils_python_tkinter() {
392 if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
393 eerror "Use PYTHON_USE_WITH=\"xml\" and python_pkg_setup() instead of ${FUNCNAME}()." 449 eerror "Use PYTHON_USE_WITH=\"xml\" and python_pkg_setup() instead of ${FUNCNAME}()."
394 die "${FUNCNAME}() cannot be used in this EAPI" 450 die "${FUNCNAME}() is banned"
395 fi
396
397 python_tkinter_exists
398} 451}

Legend:
Removed from v.1.73  
changed lines
  Added in v.1.76

  ViewVC Help
Powered by ViewVC 1.1.20