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

Diff of /eclass/python.eclass

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

Revision 1.78 Revision 1.79
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.78 2009/11/15 14:25:55 arfrever Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.79 2009/11/15 22:00:47 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.
105 echo -n "/usr/bin/python${slot}" 105 echo -n "/usr/bin/python${slot}"
106 else 106 else
107 echo -n "python${slot}" 107 echo -n "python${slot}"
108 fi 108 fi
109 109
110 if [[ "${ABI}" != "${DEFAULT_ABI}" ]]; then 110 if [[ -n "${ABI}" && "${ABI}" != "${DEFAULT_ABI}" && "${DEFAULT_ABI}" != "default" ]]; then
111 echo -n "-${ABI}" 111 echo -n "-${ABI}"
112 fi 112 fi
113} 113}
114 114
115unset PYTHON_ABIS 115unset PYTHON_ABIS
258 die "dev-lang/python:${PYTHON_ABI} isn't installed" 258 die "dev-lang/python:${PYTHON_ABI} isn't installed"
259 fi 259 fi
260 260
261 # Ensure that EPYTHON variable is respected. 261 # Ensure that EPYTHON variable is respected.
262 if [[ "$(EPYTHON="$(PYTHON)" python -c 'from sys import version_info; print(".".join([str(x) for x in version_info[:2]]))')" != "${PYTHON_ABI}" ]]; then 262 if [[ "$(EPYTHON="$(PYTHON)" python -c 'from sys import version_info; print(".".join([str(x) for x in version_info[:2]]))')" != "${PYTHON_ABI}" ]]; then
263 eerror "python: '$(type -p python)'"
264 eerror "ABI: '${ABI}'"
265 eerror "DEFAULT_ABI: '${DEFAULT_ABI}'"
266 eerror "EPYTHON: '$(PYTHON)'"
267 eerror "PYTHON_ABI: '${PYTHON_ABI}'"
268 eerror "Version of enabled Python: '$(EPYTHON="$(PYTHON)" python -c 'from sys import version_info; print(".".join([str(x) for x in version_info[:2]]))')'"
263 die "'python' doesn't respect EPYTHON variable" 269 die "'python' doesn't respect EPYTHON variable"
264 fi 270 fi
265 done 271 done
266 PYTHON_ABIS_SANITY_CHECKS="1" 272 PYTHON_ABIS_SANITY_CHECKS="1"
267 fi 273 fi
1014 eend "${return_code}" 1020 eend "${return_code}"
1015 fi 1021 fi
1016} 1022}
1017 1023
1018# @FUNCTION: python_mod_cleanup 1024# @FUNCTION: python_mod_cleanup
1019# @USAGE: [directory] 1025# @USAGE: [directory|file]
1020# @DESCRIPTION: 1026# @DESCRIPTION:
1021# Run with optional arguments, where arguments are directories of 1027# Run with optional arguments, where arguments are Python modules. If none given,
1022# python modules. If none given, it will look in /usr/lib/python[0-9].[0-9]. 1028# it will look in /usr/lib/python[0-9].[0-9].
1023# 1029#
1024# It will recursively scan all compiled Python modules in the directories and 1030# It will recursively scan all compiled Python modules in the directories and
1025# determine if they are orphaned (i.e. their corresponding .py files are missing.) 1031# determine if they are orphaned (i.e. their corresponding .py files are missing.)
1026# If they are, then it will remove their corresponding .pyc and .pyo files. 1032# If they are, then it will remove their corresponding .pyc and .pyo files.
1027# 1033#

Legend:
Removed from v.1.78  
changed lines
  Added in v.1.79

  ViewVC Help
Powered by ViewVC 1.1.20