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

Diff of /eclass/distutils.eclass

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

Revision 1.74 Revision 1.75
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.74 2010/03/04 17:49:03 arfrever Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.75 2010/05/25 15:07:04 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#
218# @DESCRIPTION: 218# @DESCRIPTION:
219# The distutils src_test function. This function is exported, when DISTUTILS_SRC_TEST variable is set. 219# The distutils src_test function. This function is exported, when DISTUTILS_SRC_TEST variable is set.
220# In ebuilds of packages supporting installation for multiple versions of Python, this function 220# In ebuilds of packages supporting installation for multiple versions of Python, this function
221# calls distutils_src_test_pre_hook() and distutils_src_test_post_hook(), if they are defined. 221# calls distutils_src_test_pre_hook() and distutils_src_test_post_hook(), if they are defined.
222distutils_src_test() { 222distutils_src_test() {
223 if [[ "${EBUILD_PHASE}" != "test" ]]; then
224 die "${FUNCNAME}() can be used only in src_test() phase"
225 fi
226
223 _python_set_color_variables 227 _python_set_color_variables
224 228
225 if [[ "${DISTUTILS_SRC_TEST}" == "setup.py" ]]; then 229 if [[ "${DISTUTILS_SRC_TEST}" == "setup.py" ]]; then
226 if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then 230 if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
227 distutils_testing() { 231 distutils_testing() {
354 fi 358 fi
355 359
356 _python_initialize_prefix_variables 360 _python_initialize_prefix_variables
357 361
358 local pylibdir pymod 362 local pylibdir pymod
359 if [[ -z "${PYTHON_MODNAME}" ]]; then 363 if [[ -z "$(declare -p PYTHON_MODNAME 2> /dev/null)" ]]; then
360 for pylibdir in "${EROOT}"usr/$(get_libdir)/python* "${EROOT}"/usr/share/jython-*/Lib; do 364 for pylibdir in "${EROOT}"usr/$(get_libdir)/python* "${EROOT}"/usr/share/jython-*/Lib; do
361 if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then 365 if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then
362 PYTHON_MODNAME="${PN}" 366 PYTHON_MODNAME="${PN}"
363 fi 367 fi
364 done 368 done
365 fi 369 fi
366 370
371 if [[ -n "${PYTHON_MODNAME}" ]]; then
367 if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then 372 if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
368 python_mod_optimize ${PYTHON_MODNAME} 373 python_mod_optimize ${PYTHON_MODNAME}
369 else 374 else
370 for pymod in ${PYTHON_MODNAME}; do 375 for pymod in ${PYTHON_MODNAME}; do
371 python_mod_optimize "$(python_get_sitedir)/${pymod}" 376 python_mod_optimize "$(python_get_sitedir)/${pymod}"
372 done 377 done
378 fi
373 fi 379 fi
374} 380}
375 381
376# @FUNCTION: distutils_pkg_postrm 382# @FUNCTION: distutils_pkg_postrm
377# @DESCRIPTION: 383# @DESCRIPTION:
385 fi 391 fi
386 392
387 _python_initialize_prefix_variables 393 _python_initialize_prefix_variables
388 394
389 local pylibdir pymod 395 local pylibdir pymod
390 if [[ -z "${PYTHON_MODNAME}" ]]; then 396 if [[ -z "$(declare -p PYTHON_MODNAME 2> /dev/null)" ]]; then
391 for pylibdir in "${EROOT}"usr/$(get_libdir)/python* "${EROOT}"/usr/share/jython-*/Lib; do 397 for pylibdir in "${EROOT}"usr/$(get_libdir)/python* "${EROOT}"/usr/share/jython-*/Lib; do
392 if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then 398 if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then
393 PYTHON_MODNAME="${PN}" 399 PYTHON_MODNAME="${PN}"
394 fi 400 fi
395 done 401 done
405 python_mod_cleanup "${pylibdir#${EROOT%/}}/site-packages/${pymod}" 411 python_mod_cleanup "${pylibdir#${EROOT%/}}/site-packages/${pymod}"
406 fi 412 fi
407 done 413 done
408 done 414 done
409 fi 415 fi
410 else
411 python_mod_cleanup
412 fi 416 fi
413} 417}
414 418
415# @FUNCTION: distutils_python_version 419# @FUNCTION: distutils_python_version
416# @DESCRIPTION: 420# @DESCRIPTION:

Legend:
Removed from v.1.74  
changed lines
  Added in v.1.75

  ViewVC Help
Powered by ViewVC 1.1.20