summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2012-10-29 09:23:58 +0000
committerMichał Górny <mgorny@gentoo.org>2012-10-29 09:23:58 +0000
commit509bd2b7527c2af7396a9f0a52213af2d3423160 (patch)
tree7a436033c08045d406685ed88be793dae686b968 /eclass/python-r1.eclass
parentVersion bump, bugfixes and security fixes. Remove previous vulnerable 4.5.x v... (diff)
downloadgentoo-2-509bd2b7527c2af7396a9f0a52213af2d3423160.tar.gz
gentoo-2-509bd2b7527c2af7396a9f0a52213af2d3423160.tar.bz2
gentoo-2-509bd2b7527c2af7396a9f0a52213af2d3423160.zip
Add getters for common Python variables.
Diffstat (limited to 'eclass/python-r1.eclass')
-rw-r--r--eclass/python-r1.eclass48
1 files changed, 47 insertions, 1 deletions
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index b04e1b778e8b..4ce32bd092d9 100644
--- a/eclass/python-r1.eclass
+++ b/eclass/python-r1.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.8 2012/10/29 09:22:13 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.9 2012/10/29 09:23:58 mgorny Exp $
# @ECLASS: python-r1
# @MAINTAINER:
@@ -283,6 +283,52 @@ python_export() {
done
}
+# @FUNCTION: python_get_PYTHON
+# @USAGE: [<impl>]
+# @DESCRIPTION:
+# Obtain and print the path to the Python interpreter for the given
+# implementation. If no implementation is provided, ${EPYTHON} will
+# be used.
+#
+# If you just need to have PYTHON set (and exported), then it is better
+# to use python_export() directly instead.
+python_get_PYTHON() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ python_export "${@}" PYTHON
+ echo "${PYTHON}"
+}
+
+# @FUNCTION: python_get_EPYTHON
+# @USAGE: <impl>
+# @DESCRIPTION:
+# Obtain and print the EPYTHON value for the given implementation.
+#
+# If you just need to have EPYTHON set (and exported), then it is better
+# to use python_export() directly instead.
+python_get_EPYTHON() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ python_export "${@}" EPYTHON
+ echo "${EPYTHON}"
+}
+
+# @FUNCTION: python_get_sitedir
+# @USAGE: [<impl>]
+# @DESCRIPTION:
+# Obtain and print the 'site-packages' path for the given
+# implementation. If no implementation is provided, ${EPYTHON} will
+# be used.
+#
+# If you just need to have PYTHON_SITEDIR set (and exported), then it is
+# better to use python_export() directly instead.
+python_get_sitedir() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ python_export "${@}" PYTHON_SITEDIR
+ echo "${PYTHON_SITEDIR}"
+}
+
# @FUNCTION: python_copy_sources
# @DESCRIPTION:
# Create a single copy of the package sources (${S}) for each enabled