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

Diff of /eclass/python.eclass

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

Revision 1.71 Revision 1.72
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.71 2009/09/09 04:16:58 arfrever Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.72 2009/09/11 19:55:05 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# 8#
249# @USAGE: [--action-message message] [-d|--default-function] [--failure-message message] [--nonfatal] [-q|--quiet] [-s|--separate-build-dirs] [--] <function> [arguments] 249# @USAGE: [--action-message message] [-d|--default-function] [--failure-message message] [--nonfatal] [-q|--quiet] [-s|--separate-build-dirs] [--] <function> [arguments]
250# @DESCRIPTION: 250# @DESCRIPTION:
251# Execute specified function for each value of PYTHON_ABIS, optionally passing additional 251# Execute specified function for each value of PYTHON_ABIS, optionally passing additional
252# arguments. The specified function can use PYTHON_ABI and BUILDDIR variables. 252# arguments. The specified function can use PYTHON_ABI and BUILDDIR variables.
253python_execute_function() { 253python_execute_function() {
254 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" 254 local action action_message action_message_template= default_function="0" failure_message failure_message_template= function nonfatal="0" previous_directory_stack_length PYTHON_ABI quiet="0" separate_build_dirs="0"
255 255
256 while (($#)); do 256 while (($#)); do
257 case "$1" in 257 case "$1" in
258 --action-message) 258 --action-message)
259 action_message_template="$2" 259 action_message_template="$2"
381 pushd "${BUILDDIR}" > /dev/null || die "pushd failed" 381 pushd "${BUILDDIR}" > /dev/null || die "pushd failed"
382 else 382 else
383 export BUILDDIR="${S}" 383 export BUILDDIR="${S}"
384 fi 384 fi
385 385
386 previous_directory_stack_length="${#DIRSTACK[@]}"
387
386 if ! has "${EAPI}" 0 1 2 && has "${PYTHON_ABI}" ${FAILURE_TOLERANT_PYTHON_ABIS}; then 388 if ! has "${EAPI}" 0 1 2 && has "${PYTHON_ABI}" ${FAILURE_TOLERANT_PYTHON_ABIS}; then
387 EPYTHON="$(PYTHON)" nonfatal "${function}" "$@" 389 EPYTHON="$(PYTHON)" nonfatal "${function}" "$@"
388 else 390 else
389 EPYTHON="$(PYTHON)" "${function}" "$@" 391 EPYTHON="$(PYTHON)" "${function}" "$@"
390 fi 392 fi
416 fi 418 fi
417 else 419 else
418 die "${failure_message}" 420 die "${failure_message}"
419 fi 421 fi
420 fi 422 fi
423
424 if [[ "${#DIRSTACK[@]}" -lt "${previous_directory_stack_length}" ]]; then
425 die "Directory stack decreased illegally"
426 fi
427
428 while [[ "${#DIRSTACK[@]}" -gt "${previous_directory_stack_length}" ]]; do
429 popd > /dev/null || die "popd failed"
430 done
421 431
422 if [[ "${separate_build_dirs}" == "1" ]]; then 432 if [[ "${separate_build_dirs}" == "1" ]]; then
423 popd > /dev/null || die "popd failed" 433 popd > /dev/null || die "popd failed"
424 fi 434 fi
425 unset BUILDDIR 435 unset BUILDDIR

Legend:
Removed from v.1.71  
changed lines
  Added in v.1.72

  ViewVC Help
Powered by ViewVC 1.1.20