mgorny 14/04/19 10:29:06
Modified: ChangeLog python-r1.eclass
Log:
Support substituting ${PYTHON_USEDEP} in python_gen_cond_dep().
Revision Changes Path
1.1213 eclass/ChangeLog
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1213&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1213&content-type=text/plain
diff :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1212&r2=1.1213
Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.1212
retrieving revision 1.1213
diff -u -r1.1212 -r1.1213
--- ChangeLog 17 Apr 2014 20:28:37 -0000 1.1212
+++ ChangeLog 19 Apr 2014 10:29:06 -0000 1.1213
@@ -1,6 +1,9 @@
# ChangeLog for eclass directory
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1212 2014/04/17
20:28:37 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1213 2014/04/19
10:29:06 mgorny Exp $
+
+ 19 Apr 2014; Michał Górny <[email protected]> python-r1.eclass:
+ Support substituting ${PYTHON_USEDEP} in python_gen_cond_dep().
17 Apr 2014; Michał Górny <[email protected]> git-r3.eclass:
Automatically switch to EGIT_CLONE_TYPE=single+tags for Google Code.
1.72 eclass/python-r1.eclass
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-r1.eclass?rev=1.72&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-r1.eclass?rev=1.72&content-type=text/plain
diff :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-r1.eclass?r1=1.71&r2=1.72
Index: python-r1.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -r1.71 -r1.72
--- python-r1.eclass 9 Apr 2014 21:34:10 -0000 1.71
+++ python-r1.eclass 19 Apr 2014 10:29:06 -0000 1.72
@@ -1,6 +1,6 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.71 2014/04/09
21:34:10 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.72 2014/04/19
10:29:06 mgorny Exp $
# @ECLASS: python-r1
# @MAINTAINER:
@@ -340,20 +340,24 @@
# of Python implementations which are both in PYTHON_COMPAT and match
# any of the patterns passed as the remaining parameters.
#
-# Please note that USE constraints on the package need to be enforced
-# separately. Therefore, the dependency usually needs to use
-# python_gen_usedep as well.
+# In order to enforce USE constraints on the packages, verbatim
+# '${PYTHON_USEDEP}' (quoted!) may be placed in the dependency
+# specification. It will get expanded within the function into a proper
+# USE dependency string.
#
# Example:
# @CODE
# PYTHON_COMPAT=( python{2_5,2_6,2_7} )
-# RDEPEND="$(python_gen_cond_dep dev-python/unittest2 python{2_5,2_6})"
+# RDEPEND="$(python_gen_cond_dep \
+# 'dev-python/unittest2[${PYTHON_USEDEP}]' python{2_5,2_6})"
# @CODE
#
# It will cause the variable to look like:
# @CODE
-# RDEPEND="python_targets_python2_5? ( dev-python/unittest2 )
-# python_targets_python2_6? ( dev-python/unittest2 )"
+# RDEPEND="python_targets_python2_5? (
+# dev-python/unittest2[python_targets_python2_5?] )
+# python_targets_python2_6? (
+# dev-python/unittest2[python_targets_python2_6?] )"
# @CODE
python_gen_cond_dep() {
debug-print-function ${FUNCNAME} "${@}"
@@ -364,6 +368,12 @@
local dep=${1}
shift
+ # substitute ${PYTHON_USEDEP} if used
+ if [[ ${dep} == *'${PYTHON_USEDEP}'* ]]; then
+ local PYTHON_USEDEP=$(python_gen_usedep "${@}")
+ dep=${dep//\$\{PYTHON_USEDEP\}/${PYTHON_USEDEP}}
+ fi
+
for impl in "${PYTHON_COMPAT[@]}"; do
_python_impl_supported "${impl}" || continue