* [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog python-any-r1.eclass python-utils-r1.eclass
@ 2014-11-09 22:27 Michal Gorny (mgorny)
0 siblings, 0 replies; only message in thread
From: Michal Gorny (mgorny) @ 2014-11-09 22:27 UTC (permalink / raw
To: gentoo-commits
mgorny 14/11/09 22:27:58
Modified: ChangeLog python-any-r1.eclass
python-utils-r1.eclass
Log:
Move the has_version checks on installed implementations to python_is_installed() function. Accept PyPy when the implementation is installed, even if the virtual is not.
Revision Changes Path
1.1412 eclass/ChangeLog
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1412&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1412&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1411&r2=1.1412
Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.1411
retrieving revision 1.1412
diff -u -r1.1411 -r1.1412
--- ChangeLog 9 Nov 2014 21:34:29 -0000 1.1411
+++ ChangeLog 9 Nov 2014 22:27:58 -0000 1.1412
@@ -1,6 +1,12 @@
# ChangeLog for eclass directory
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1411 2014/11/09 21:34:29 dilfridge Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1412 2014/11/09 22:27:58 mgorny Exp $
+
+ 09 Nov 2014; Michał Górny <mgorny@gentoo.org> python-any-r1.eclass,
+ python-utils-r1.eclass:
+ Move the has_version checks on installed implementations to
+ python_is_installed() function. Accept PyPy when the implementation is
+ installed, even if the virtual is not.
09 Nov 2014; Andreas K. Huettel <dilfridge@gentoo.org> perl-module.eclass:
Add docs and deprecate perlinfo and fixlocalpod
1.18 eclass/python-any-r1.eclass
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-any-r1.eclass?rev=1.18&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-any-r1.eclass?rev=1.18&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-any-r1.eclass?r1=1.17&r2=1.18
Index: python-any-r1.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/python-any-r1.eclass,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- python-any-r1.eclass 8 Apr 2014 16:05:30 -0000 1.17
+++ python-any-r1.eclass 9 Nov 2014 22:27:58 -0000 1.18
@@ -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-any-r1.eclass,v 1.17 2014/04/08 16:05:30 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-any-r1.eclass,v 1.18 2014/11/09 22:27:58 mgorny Exp $
# @ECLASS: python-any-r1
# @MAINTAINER:
@@ -239,9 +239,7 @@
esac
if has "${i}" "${PYTHON_COMPAT[@]}"; then
- local PYTHON_PKG_DEP
- python_export "${i}" PYTHON_PKG_DEP
- if ROOT=/ has_version "${PYTHON_PKG_DEP}"; then
+ if python_is_installed "${i}"; then
if declare -f python_check_deps >/dev/null; then
local PYTHON_USEDEP="python_targets_${i}(-),python_single_target_${i}(+)"
python_check_deps
1.64 eclass/python-utils-r1.eclass
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-utils-r1.eclass?rev=1.64&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-utils-r1.eclass?rev=1.64&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-utils-r1.eclass?r1=1.63&r2=1.64
Index: python-utils-r1.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- python-utils-r1.eclass 5 Nov 2014 23:03:01 -0000 1.63
+++ python-utils-r1.eclass 9 Nov 2014 22:27:58 -0000 1.64
@@ -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-utils-r1.eclass,v 1.63 2014/11/05 23:03:01 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.64 2014/11/09 22:27:58 mgorny Exp $
# @ECLASS: python-utils-r1
# @MAINTAINER:
@@ -919,6 +919,38 @@
[[ ${impl} == python3* || ${impl} == pypy3 ]]
}
+# @FUNCTION: python_is_installed
+# @USAGE: [<impl>]
+# @DESCRIPTION:
+# Check whether the interpreter for <impl> (or ${EPYTHON}) is installed.
+# Uses has_version with a proper dependency string.
+#
+# Returns 0 (true) if it is, 1 (false) otherwise.
+python_is_installed() {
+ local impl=${1:-${EPYTHON}}
+ [[ ${impl} ]] || die "${FUNCNAME}: no impl nor EPYTHON"
+
+ # for has_version
+ local -x ROOT=/
+ case "${impl}" in
+ pypy|pypy3)
+ local append=
+ if [[ ${PYTHON_REQ_USE} ]]; then
+ append=[${PYTHON_REQ_USE}]
+ fi
+
+ # be happy with just the interpeter, no need for the virtual
+ has_version "dev-python/${impl}${append}" \
+ || has_version "dev-python/${impl}-bin${append}"
+ ;;
+ *)
+ local PYTHON_PKG_DEP
+ python_export "${impl}" PYTHON_PKG_DEP
+ has_version "${PYTHON_PKG_DEP}"
+ ;;
+ esac
+}
+
# @FUNCTION: python_fix_shebang
# @USAGE: [-f|--force] [-q|--quiet] <path>...
# @DESCRIPTION:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-11-09 22:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-09 22:27 [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog python-any-r1.eclass python-utils-r1.eclass Michal Gorny (mgorny)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox