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

Diff of /eclass/python.eclass

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

Revision 1.80 Revision 1.81
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2009 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/python.eclass,v 1.80 2009/11/22 13:48:16 arfrever Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.81 2009/11/22 16:45:54 arfrever Exp $
4 4
5# @ECLASS: python.eclass 5# @ECLASS: python.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# python@gentoo.org 7# python@gentoo.org
8# @BLURB: A utility eclass that should be inherited by anything that deals with Python or Python modules. 8# @BLURB: A utility eclass that should be inherited by anything that deals with Python or Python modules.
333 rm -f "${dir}" || die "Deletion of '${dir}' failed" 333 rm -f "${dir}" || die "Deletion of '${dir}' failed"
334 ln -s "${dir}-${PYTHON_ABI}" "${dir}" || die "Creation of '${dir}' directory symlink failed" 334 ln -s "${dir}-${PYTHON_ABI}" "${dir}" || die "Creation of '${dir}' directory symlink failed"
335} 335}
336 336
337# @FUNCTION: python_execute_function 337# @FUNCTION: python_execute_function
338# @USAGE: [--action-message message] [-d|--default-function] [--failure-message message] [--nonfatal] [-q|--quiet] [-s|--separate-build-dirs] [--] <function> [arguments] 338# @USAGE: [--action-message message] [-d|--default-function] [--failure-message message] [--nonfatal] [-q|--quiet] [-s|--separate-build-dirs] [--source-dir source_directory] [--] <function> [arguments]
339# @DESCRIPTION: 339# @DESCRIPTION:
340# Execute specified function for each value of PYTHON_ABIS, optionally passing additional 340# Execute specified function for each value of PYTHON_ABIS, optionally passing additional
341# arguments. The specified function can use PYTHON_ABI and BUILDDIR variables. 341# arguments. The specified function can use PYTHON_ABI and BUILDDIR variables.
342python_execute_function() { 342python_execute_function() {
343 local action action_message action_message_template= default_function="0" failure_message failure_message_template= function nonfatal="0" previous_directory previous_directory_stack previous_directory_stack_length PYTHON_ABI quiet="0" separate_build_dirs="0" 343 local action action_message action_message_template= default_function="0" failure_message failure_message_template= function nonfatal="0" previous_directory previous_directory_stack previous_directory_stack_length PYTHON_ABI quiet="0" separate_build_dirs="0" source_dir=
344 344
345 while (($#)); do 345 while (($#)); do
346 case "$1" in 346 case "$1" in
347 --action-message) 347 --action-message)
348 action_message_template="$2" 348 action_message_template="$2"
362 quiet="1" 362 quiet="1"
363 ;; 363 ;;
364 -s|--separate-build-dirs) 364 -s|--separate-build-dirs)
365 separate_build_dirs="1" 365 separate_build_dirs="1"
366 ;; 366 ;;
367 --source-dir)
368 source_dir="$2"
369 shift
370 ;;
367 --) 371 --)
368 break 372 break
369 ;; 373 ;;
370 -*) 374 -*)
371 die "${FUNCNAME}(): Unrecognized option '$1'" 375 die "${FUNCNAME}(): Unrecognized option '$1'"
374 break 378 break
375 ;; 379 ;;
376 esac 380 esac
377 shift 381 shift
378 done 382 done
383
384 if [[ -n "${source_dir}" && "${separate_build_dirs}" == 0 ]]; then
385 die "${FUNCNAME}(): '--source-dir' option can be specified only with '--separate-build-dirs' option"
386 fi
379 387
380 if [[ "${default_function}" == "0" ]]; then 388 if [[ "${default_function}" == "0" ]]; then
381 if [[ "$#" -eq "0" ]]; then 389 if [[ "$#" -eq "0" ]]; then
382 die "${FUNCNAME}(): Missing function name" 390 die "${FUNCNAME}(): Missing function name"
383 fi 391 fi
464 fi 472 fi
465 echo " ${GREEN}*${NORMAL} ${BLUE}${action_message}${NORMAL}" 473 echo " ${GREEN}*${NORMAL} ${BLUE}${action_message}${NORMAL}"
466 fi 474 fi
467 475
468 if [[ "${separate_build_dirs}" == "1" ]]; then 476 if [[ "${separate_build_dirs}" == "1" ]]; then
477 if [[ -n "${source_dir}" ]]; then
478 export BUILDDIR="${S}/${source_dir}-${PYTHON_ABI}"
479 else
469 export BUILDDIR="${S}-${PYTHON_ABI}" 480 export BUILDDIR="${S}-${PYTHON_ABI}"
481 fi
470 pushd "${BUILDDIR}" > /dev/null || die "pushd failed" 482 pushd "${BUILDDIR}" > /dev/null || die "pushd failed"
471 else 483 else
472 export BUILDDIR="${S}" 484 export BUILDDIR="${S}"
473 fi 485 fi
474 486

Legend:
Removed from v.1.80  
changed lines
  Added in v.1.81

  ViewVC Help
Powered by ViewVC 1.1.20