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

Diff of /eclass/python.eclass

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

Revision 1.126 Revision 1.127
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 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.126 2011/07/08 07:48:38 djc Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.127 2011/07/08 07:49:36 djc Exp $
4 4
5# @ECLASS: python.eclass 5# @ECLASS: python.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Gentoo Python Project <python@gentoo.org> 7# Gentoo Python Project <python@gentoo.org>
8# @BLURB: Eclass for Python packages 8# @BLURB: Eclass for Python packages
1422 fi 1422 fi
1423 1423
1424 _python_check_python_pkg_setup_execution 1424 _python_check_python_pkg_setup_execution
1425 _python_initialize_prefix_variables 1425 _python_initialize_prefix_variables
1426 1426
1427 local b file files=() intermediate_installation_images_directory PYTHON_ABI quiet="0" regex shebang version_executable wrapper_scripts=() wrapper_scripts_set=() 1427 local absolute_file b file files=() intermediate_installation_images_directory PYTHON_ABI quiet="0" regex shebang version_executable wrapper_scripts=() wrapper_scripts_set=()
1428 1428
1429 while (($#)); do 1429 while (($#)); do
1430 case "$1" in 1430 case "$1" in
1431 -q|--quiet) 1431 -q|--quiet)
1432 quiet="1" 1432 quiet="1"
1514 break 1514 break
1515 fi 1515 fi
1516 done 1516 done
1517 fi 1517 fi
1518 1518
1519 [[ "${version_executable}" == "0" || ! -x "${file}" ]] && continue 1519 [[ "${version_executable}" == "0" ]] && continue
1520 1520
1521 if [[ -L "${file}" ]]; then
1522 absolute_file="$(readlink "${file}")"
1523 if [[ "${absolute_file}" == /* ]]; then
1524 absolute_file="${intermediate_installation_images_directory}/${PYTHON_ABI}${EPREFIX}/${absolute_file##/}"
1525 else
1526 if [[ "${file}" == */* ]]; then
1527 absolute_file="${intermediate_installation_images_directory}/${PYTHON_ABI}${EPREFIX}/${file%/*}/${absolute_file}"
1528 else
1529 absolute_file="${intermediate_installation_images_directory}/${PYTHON_ABI}${EPREFIX}/${absolute_file}"
1530 fi
1531 fi
1532 else
1533 absolute_file="${intermediate_installation_images_directory}/${PYTHON_ABI}${EPREFIX}/${file}"
1534 fi
1535
1536 [[ ! -x "${absolute_file}" ]] && continue
1537
1521 shebang="$(head -n1 "${file}")" || die "Extraction of shebang from '${file}' failed" 1538 shebang="$(head -n1 "${absolute_file}")" || die "Extraction of shebang from '${absolute_file}' failed"
1522 1539
1523 if [[ "${version_executable}" == "2" ]]; then 1540 if [[ "${version_executable}" == "2" ]]; then
1524 wrapper_scripts+=("${ED}${file}") 1541 wrapper_scripts+=("${ED}${file}")
1525 elif [[ "${version_executable}" == "1" ]]; then 1542 elif [[ "${version_executable}" == "1" ]]; then
1526 if [[ "${shebang}" =~ ${_PYTHON_SHEBANG_BASE_PART_REGEX}([[:digit:]]+(\.[[:digit:]]+)?)?($|[[:space:]]+) ]]; then 1543 if [[ "${shebang}" =~ ${_PYTHON_SHEBANG_BASE_PART_REGEX}([[:digit:]]+(\.[[:digit:]]+)?)?($|[[:space:]]+) ]]; then
1537 fi 1554 fi
1538 1555
1539 mv "${file}" "${file}-${PYTHON_ABI}" || die "Renaming of '${file}' failed" 1556 mv "${file}" "${file}-${PYTHON_ABI}" || die "Renaming of '${file}' failed"
1540 1557
1541 if [[ "${shebang}" =~ ${_PYTHON_SHEBANG_BASE_PART_REGEX}[[:digit:]]*($|[[:space:]]+) ]]; then 1558 if [[ "${shebang}" =~ ${_PYTHON_SHEBANG_BASE_PART_REGEX}[[:digit:]]*($|[[:space:]]+) ]]; then
1559 if [[ -L "${file}-${PYTHON_ABI}" ]]; then
1560 python_convert_shebangs $([[ "${quiet}" == "1" ]] && echo --quiet) "${PYTHON_ABI}" "${absolute_file}"
1561 else
1542 python_convert_shebangs $([[ "${quiet}" == "1" ]] && echo --quiet) "${PYTHON_ABI}" "${file}-${PYTHON_ABI}" 1562 python_convert_shebangs $([[ "${quiet}" == "1" ]] && echo --quiet) "${PYTHON_ABI}" "${file}-${PYTHON_ABI}"
1563 fi
1543 fi 1564 fi
1544 done 1565 done
1545 1566
1546 popd > /dev/null || die "popd failed" 1567 popd > /dev/null || die "popd failed"
1547 1568

Legend:
Removed from v.1.126  
changed lines
  Added in v.1.127

  ViewVC Help
Powered by ViewVC 1.1.20